Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial

Adam Bell
1,176 PointsOutput a sentence that takes both the noun and past tense verb using a single statement. It should look like this......
String name = console.readLine("Scorpion"); String pastTenseVerb = console.readLine("hated"); console.printf("%s really %s this coding exercise.", name, pastTenseVerb);
9 Answers

Kevin VanderWulp
5,180 Pointsconsole.readLine shouldn't take any parameters since this function does not output, but takes input from the user when it is run in the console.
String name = console.readLine();
String pastTenseVerb = console.readLine();
console.printf("%s really %s this coding exercise.", name, pastTenseVerb);

Kevin VanderWulp
5,180 PointsSystem.out.print("Enter a noun: ");
String name = console.readLine();
System.out.print("Enter a past tense verb: ");
String pastTenseVerb = console.readline();
console.printf("%s really %s this coding exercise.", name, pastTenseVerb);
Try that. Like I said, the console.readLine() function shouldn't take any parameters, so there should be no text inside of the parenthesis of readLine().

Adam Bell
1,176 PointsThis is what I did. Not having any luck.
String name = console.readLine("name"); String pastTenseVerb = console.readline("Enter a past tense verb."); console.printf("%s really %s this coding exercise.", name, pastTenseVerb);

Adam Bell
1,176 PointsSorry, it's not working.

Kevin VanderWulp
5,180 PointsI'm not sure what will work without being able to see what the challenge is asking for specifically.

Adam Bell
1,176 PointsOkay. Here's the exact question. "Output a sentence that takes both the name and past tense verb using a single statement. It should look like this: name really past tense verb this coding exercise"

Adam Bell
1,176 Points{{{String name = console.readLine("Adam"); String pastTenseVerb = console.readLine("hates"); console.printf("%s really %s this coding exercise.", name, pastTenseVerb);}}};

Adam Bell
1,176 Points^^^That was the answer. I tried use markdown but I'm still getting the hang of all this. Thanks Kevin for your time and support.

Sanora Griffin
2,972 Pointsyeah i'm having the same issue with the input below:
String name = console.readLine("Enter your name: "); String pastTenseVerb = console.readLine("Enter a past tense verb: "); console.printf(" $s really %s this coding exercise.", name, pastTenseVerb);

Sanora Griffin
2,972 Pointsyeah i'm having the same issue with the input below:
String name = console.readLine("Enter your name: "); String pastTenseVerb = console.readLine("Enter a past tense verb: "); console.printf(" $s really %s this coding exercise.", name, pastTenseVerb);
Alvaro Gutierrez
1,471 PointsAlvaro Gutierrez
1,471 PointsYeah Adam, Kevin is right. However, you want to also ask the user what to enter as a name. String name = console.readLine("Enter a name: ");
Adam Bell
1,176 PointsAdam Bell
1,176 PointsHey buddy I've GOT IT!!! I can't BELIEVE what I was doing wrong. smh