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 trialAly Khedr
470 PointsAny Idea what's wrong?
Supposed to make a program that will send certain comments for certain numbers
string input = Console.ReadLine();
int temperature = int.Parse(input);
if(temperature <= 20)
{
Console.WriteLine("Too Cold!");
}
else if(temperature <= 22)
{
Console.WriteLine("Just right.");
}
else
{
Console.WriteLine("Too hot!");
2 Answers
Steven Parker
231,269 PointsHi, I got your request.
It looks like you just forgot to close that last code block after the "else". Just add the missing brace at the end and you should have it. Otherwise, good job!
Antonio De Rose
20,885 Pointsmissing the last curly brace
string input = Console.ReadLine();
int temperature = int.Parse(input);
if(temperature <= 20)
{
Console.WriteLine("Too Cold!");
}
else if(temperature <= 22)
{
Console.WriteLine("Just right.");
}
else
{
Console.WriteLine("Too hot!");
}// you are missing this curly brace