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 trial1 Answer
Michael Liebegott
3,960 PointsHey Matthias!
The challenge (Part One of Formatting Output) requires you to
Declare a variable named firstName and initialize it to the string returned from a call to Console.ReadLine().
Let's break it down step-by-step:
- You want to declare a variable of type string. To do this, you need to use the word "string" in front of the variable name, like so:
string firstName;
(Don't forget the semi-colon! C# needs these to understand where the line ends.)
- You then want to assign it the value returned from the "Console.ReadLine()" method. To do this, simply assign (the equals operator, =) the value (the input received from the ReadLine() method) to the string variable you declared earlier (string firstName;). That's done like so:
string firstName = Console.ReadLine();
Hopefully this helps. :-)
Matthias Smartt
186 Pointsyes thank you
A X
12,842 PointsA X
12,842 PointsWhat part of the code challenge are you stuck on? Part 1?