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 trialZeynal Zeynalov
281 PointsCan not understand what is my mistake
It always tells me that I entered "bogus" but it gave me "javais not C#" for example.
Could you please help me to understatnd my mistake
string language = Console.ReadLine();
if (language == "C#")
{
Console.WriteLine("C# Rocks!");
}
else
{
Console.WriteLine(language + "is not C#");
}
Simon Coates
28,694 PointsSimon McGuirk seems to be right (I verified). Just need to add a space in the output. However, the message I got when using your code seemed kinda messed up: 'I entered "bogus". I expected "bogus is not C#.", but got "pythonis not C#" instead.'
Steven Parker
231,210 PointsSounds like a bug in the error message. You might want to report it to Support.
2 Answers
Simon McGuirk
2,673 PointsActually got to this bit of the course. The requirements require the else output to display the language plus " is not C#." So you'll need to make sure that you add the space at the beginning of the string and full stop/period at the end " is not C#."
As for the issue the value being stored in language
, this is being actioned by the test/code checker which I assume randomly assigns a different programming language to verify the else output.
Zeynal Zeynalov
281 PointsDear Simon,
Thanks, the issue was that I had to put space prior to "is" expression.
So simple!)))
Thanks for your support guys!)))
Zeynal Zeynalov
281 PointsThanks guys!
Simon McGuirk
1,471 PointsSimon McGuirk
1,471 PointsCould it be that you're missing a space in your else output?