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! While you're at it, check out some resources Treehouse students have shared here.

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

Java Java Basics Using your New Tools Multiple Format Strings

Austin Schumacher
Austin Schumacher
155 Points

Output a sentence that takes both the name and past tense verb using a single statement.

String name = console.readLine("Enter your name" ); String pastTenseVerb = console.readLine("Enter a past tense verb" ); console.printf("%s is very %s", name, pastTenseVerb);

Multiple.java
// I've imported java.io.Console for you.  It is stored in a variable called console for you.
String name = console.readLine("Enter your name"  );
String pastTenseVerb = console.readLine("Enter a past tense verb"  );
console.printf("%s is very %s", name, pastTenseVerb);

3 Answers

Jason Anders
MOD
Jason Anders
Treehouse Moderator 145,860 Points

Hi Austin,

You have syntactically correct code; however, you are not following the instructions exactly. Instructions are very specific and must be followed explicitly, or you will get the Bummer!.

If you look at the error you are receiving for the third task

Please make sure that you are following the format __name__ really __pastTenseVerb__ described above

That should be a huge hint. The challenge is looking for a very specific string, but you are using "%s is very %s" instead of what the instructions specifically ask for "%s really %s this coding exercise.".

Once you fix that up, the rest is good to go. :)

Keep Coding! :dizzy:

Martin Gallauner
Martin Gallauner
10,808 Points

Can you please tell us on which exercise you are working on and what is your problem?

Thanks

Aren't you supposed to have a double space before closing the quote as well? String name = console.readLine("Enter your name: "); String pastTenseVerb = console.readLine("Enter a past tense verb: ");