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

Finally, read the user’s response from the console and store it back into the bookTitle variable

Finally, read the user’s response from the console and store it back into the bookTitle variable

CodeChallenge.cs
string s = "bookTitle";
System.Console.Write("Enter a book title: ");

2 Answers

Steven Parker
Steven Parker
231,210 Points

:point_right: Without giving a complete spoiler, here's a couple of hints:

  • The challenge asked you to create a variable named bookTitle (not s, did that pass the previous tasks?)
  • The initial contents of the variable are a book title (but that can be anything)
  • To get the user's input, you may want to use System.Console.ReadLine()

Hope that'll get you going.

You can also do both in one line of code at a later point.

string x = system.console.readline();