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

C# C# Basics (Retired) Console I/O Formatting Output

can someone pleaz help me with this question? i don't know what to do with it...

pleaz read my code and tell when i went wrong...

CodeChallenge.cs
Console.WriteLine(firstName);
Console.ReadLine();

2 Answers

Erick R
Erick R
5,293 Points

You are writing the firstName variable without being assigned and then you are reading something to the console. The challenge wants this:

//Get the First name and store in the variable firstName
var firstName = Console.ReadLine();
Console.WriteLine(firstName); //Print out the content
Console.WriteLine(firstName + " rocks!"); //Append the text
Erick R
Erick R
5,293 Points

the var keyword means variable if you are confused by that keyword use the string keyword

Steven Parker
Steven Parker
231,248 Points

Task 1 only requires "ReadLine", you won't need "WriteLine" until the later tasks.

What you do for "firstName" in task 1 will be very similar to what was done for "entry" in the Receiving Input video at about 3:30.