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 Console I/O

Console I/O help

I don't really know what I'm doing wrong. Its wanting me to do something with the response or result, but I don't know how.

CodeChallenge.cs
System.Console.Write("Enter a book title: ");

System.Console.Readline();

string bookTitle = "Neuromancer";

1 Answer

Steven Parker
Steven Parker
231,269 Points

It wants you to put the response coming in into your variable.

Calling ReadLine by itself doesn't really do anything. You need do something with the result, like assign it to a variable. Then you created the variable, but assigned it to a static string instead of the incoming result.

But if you move that second line down to replace that static string, you should have it.

So, you mean to put the string inside the parenthesis so the computer associates it with the code. I don't know, I found the Input/Output concept somewhat confusing.

Steven Parker
Steven Parker
231,269 Points

For task 2, you'll assign your variable (the last line up to the "="); but instead of a fixed string, you will assign it using what you currently have on the second line.

Don't worry about the I/O, just think of it as calling a method and assigning the result to a variable.

I'm still really confused, I'm really sorry, but could you explain an example I/O process like this one this one, but in a series of steps. I think I might be able to understand if the whole I/O process is laid out tangibly in front of me.

Steven Parker
Steven Parker
231,269 Points

Like I said, the I/O aspect isn't important here .. it's simple (one step) assignment from a method call:

string bookTitle = System.Console.Readline();