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 trialJoe Mark
Courses Plus Student 2,635 Pointsfollowed instructions on video, cant still get thisI
followed instructions on video, cant still get this
string entry = System.Console.ReadLine();
System.Console.WriteLine(firstName)
string firstName = System.Console.WriteLine(firstName); + entry + "rocks " = "Jeremy";
Joe Mark
Courses Plus Student 2,635 PointsExcellent! that's cool, Thanks
2 Answers
James Matthews
21,610 PointsHi Joe,
Close! You simply need to initialize the firstName variable to the string, and you only need to use the concatenate operator (+) to pass this challenge.
string firstName = Console.ReadLine();
Console.WriteLine(firstName + " rocks!");
Hope this helps!
Joe Mark
Courses Plus Student 2,635 PointsThanks so much James, I had to sleep over it, wow! I appreciate.
Steven Parker
231,235 PointsThere are a few issues in this code.
- the first line should be assigning the variable firstName (not entry)
- the second line is missing a semicolon (;) at the end
- for task 3, you'll concatenate the word " rocks!" to firstName inside the call to WriteLine
- the third line has a syntax error but is not needed for the challenge
Joe Mark
Courses Plus Student 2,635 PointsHi Steven Thanks!
Daniel Hildreth
16,170 PointsDaniel Hildreth
16,170 PointsSteven and James are right. You simply were trying to take the long way about it. All you need to do is assign the firstName variable to the ReadLine method, and then call it when you concatenate the WriteLine method.