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 trialtidjanitraore
120 PointsJava Basics
Create a new variable to store a past tense verb, so in camel case that is pastTenseVerb. Accept input from the console using the readLine method. Can you guys please help me, thanksβΊ!
// 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 here: ");
String name = console.readLine("What is your name? ");
String
2 Answers
Jason Anders
Treehouse Moderator 145,860 PointsHi Tidjani,
I feel you may have misunderstood the 2nd Task. You have the first task correct (Your first line of code). The 2nd task is syntactically identical to the first task, just with different text. Instead of name
variable, you will need to create a variable named pastTenseVerb
. And instead of saying "enter name here: " it should probably read "enter verb here: ". Although that doesn't matter, you can have it say what you would like it to. So, everything else is identical to the first line, except for those two things.
Keep Coding! :)
Alex Bratkovskij
5,329 PointsYou need to change the name for second String variable, you calling it name* again, and task asks you to call it **pastTenseVerb :)
Hope that helped,
-Alex
Alexander Davison
65,469 PointsHi Alex, I'm Alex.
~Alex
lol
tidjanitraore
120 Pointstidjanitraore
120 PointsThanks Jason! 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.
I get stuck there! Can you please help me?βΊ