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
Michael Cohen355 Points
What is a format string and where do I write this "First Name" that's being asked for? What name do I use?
This is very cryptic and difficult to understand. For instance, Why do certain letters in the middle of words need capitalization?
Is there a glossary of terms and what they mean? This might be helpful as a reference...
// I have imported java.io.Console for you. It is a variable called console.
String firstName = console.readLine("What is your name? ");
String lastName = console.readLine("What is your name? ");
console.printf("Hello my name is Mike", firstName);
console.printf("Mike is learning how to write Java/n", firstName);
Camel casing is just having the first word be lowercase and any following words have a capital starting letter. So, if I said to create a variable using the words your first name and camel case it, you would put "yourFirstName". The challenges tell you what they want you to do, but not how to do it; after all, the job of a programmer is to figure out the how ;)
With that being said, in the 3rd task the challenge tells you to print the string "First name: " and then the user's first name. The user's first name is stored in the variable
firstName. You need to put a formatted string into the
printf command. Use the %s placeholder to insert the variable into the string. Anywhere the Java compiler sees a %s in the string, it is going to replace it with the variable(s) you specify.
console.printf("First name: %s", firstName);
And it's the same concept with dealing with the last name.