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 trialRahul Gupta
667 PointsWhats wrong with this code ? CodeChallenge.cs
System.Console.Write ("Enter a book title:");
System.Console.Write ("Enter a book title:");
8 Answers
Daniel Tkach
7,608 PointsWhat about the semicolon at the end? Is there a way you can attach a snapshot? Or tell me what exactly is your code, if it's that, then the semicolon is missing.
Rahul Gupta
667 PointsThe challenge is :
Use the System.Console.Write() method to print "Enter a book title: " to the console.
I have tried removing the space as well and the error is : Bummer! Make sure to use the exact message from the instructions. Note the trailing space. Copy/paste if you like!
Daniel Tkach
7,608 PointsOh I see. Well in a string, whatever is within the quotes " ", a space does matter. See if there's a space after the colon. "Enter a book title: " instead of "Enter a book title:"
It will even look better with a space otherwise when you use this in real life a person will start typing after the colon, and this looks bad: Enter a book title:The Best Story compare with: Enter a book title: The Best Story which looks clearer.
Rahul Gupta
667 PointsThis is really strange because i am making sure that is no extra spaces , i have even tried to copy paste . When i do the same code in Visual Studio it works just fine but here it does not
Daniel Tkach
7,608 PointsThe thing is, the space must be there, it is in the example, so you have to include it in your answer too :)
The question says "Enter a book title: " and you are entering it without the space "Enter a book title:", that's why you are not getting the pass.
Rahul Gupta
667 PointsThanks a lot for being patient with this . Trust me i have a space after the colon :
System.Console.Write("Enter a book title: ") even this does not work .
Rahul Gupta
667 PointsIt worked ..... Ahh thank you so much for the help . I think it was the space somewhere . I refreshed the page and wrote the code again - System.Console.Write("Enter a book title: ") and it worked ... yay . Thanks a lot
Daniel Tkach
7,608 PointsYou are welcome Rahul. Let's help each other learn this stuff which is no simple thing. See you around!
Rahul Gupta
667 PointsThank you again . Looking forward to that :)
Pierre Gadea
4,542 PointsTry the Preview tab. You might see a message there? Where are you typing the code? You may need to have it inside a method. If all else fails, try logging out and logging back in to retry on a fresh page.
Rahul Gupta
667 PointsI got this one fixed . Thank you for taking the time to help :)
Daniel Tkach
7,608 PointsDaniel Tkach
7,608 PointsThe only strange thing I see is the space after Write, but that shouldn't give you a compilation error. What's the error you get? And what's the complete code and challenge about?