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 trialMagnus Stricker
539 Pointswhat on earth am I doing wrong? Bug on C# Basics Console I/O?
First question: declare your variable for bookTitle so I enter string bookTitle; and get a big green tick Next question: Assign bookTitle the title of your favourite book so I enter bookTitle = "lordOfTheFlies"; no joy so I try string bookTitle = "lordOfTheFlies"; no joy.... I'm a wee bit stuck any help would be much appreciated.
Steve Hunter
57,712 PointsThese things happen pretty infrequntly, thankfully! Support should be able to help you get moving and, yes, you'll never forget how to declare a string
properly!! :-)
5 Answers
Magnus Stricker
539 PointsFor those who have a similar problem: I managed to make it work by answering the first 2 questions on the same line.
Krzysztof Kucharzyk
Front End Web Development Techdegree Student 4,005 PointsCommon sense tells me that this suppose to work and this is how you suppose to write your code:
String bookTitle = "lordOfTheFlies";
Magnus Stricker
539 PointsYeah thats what I wrote and it says I'm wrong...? Is it a bug maybe?
Steve Hunter
57,712 PointsI got this to work with all the code on one line and a lowercase string
keyword.
string bookTitle = "The Catcher in the Rye";
Steve.
Magnus Stricker
539 PointsThanks I tried that - still not working it comes up with this message: Bummer! Did you set 'bookTitle' using the equals sign and a string value?
Steve Hunter
57,712 PointsThere must be intermittent issues with the site, then. It is working fine here. Maybe shout support.
micram1001
33,833 PointsRan your code in challenges( all 4), no problems.
string bookTitle = "lordOfTheFlies";
System.Console.Write("Enter a book title: ");
bookTitle = System.Console.ReadLine();
Erik Sorensen
13,846 PointsI was getting the error when I had:
string bookTitle; string bookTitle = "lordOfTheFlies";
Once I removed string bookTitle;
My answer was found to be correct.
Magnus Stricker
539 PointsMagnus Stricker
539 PointsThanks for trying to help guys - I have sent a message to support so hopefully they will be able to resolve it. Highly frustrating for a newbie like me but I guess at least it helped me to be super critical and analyse my code for any mistakes