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) Perfect Validating Input

Aaron Coursolle
Aaron Coursolle
18,014 Points

Resolved: In last code challenge: An error in logic.

Hi, I noticed a small mistake in the code challenge question (it doesn't affect validating if the code is correct or not; it just might cause confusion). According to the chart, the code should print "Just right" instead of "Too cold!"

Original Challenge Wording: The following table describes my room temperature preferences. Print the message from the table when a user enters a number in the corresponding range. For example, if temperature is 21 the code should print "Too cold!" to the screen.

Temperature (deg C) -- Message; Less than 21 deg -- Too cold!; 21 deg to 22 deg -- Just right.; Greater than 22 deg -- Too hot!

3 Answers

Jeremy McLain
Jeremy McLain
Treehouse Guest Teacher

Good catch Aaron! I fixed the wording.

Hi Aaron,

Very nice spot, I'd missed that one. I'll pass the feedback on to Jeremy McLain.

Tomasz Necek
Tomasz Necek
Courses Plus Student 7,028 Points

Why I couldn't put : else if(temperature == 21||22) ?? There was a problem with " || " . Thanks.

Hi Tomasz,

temperature == 21||22 would actually read as (temperature == 21) OR (22).

Whereas I think you are meaning (temperature == 21) OR (temperature == 22)