Round to the nearest whole number 🌶️🌶️
The variable temperature holds a positive temperature with a decimal part, like 71.6. The locked line at the bottom prints a variable named roundedTemperature — an int that you have to create — which should hold temperature rounded to the nearest whole number: 71.6 rounds to 72, 71.4 rounds to 71, and 68.5 rounds up to 69. A cast by itself throws the decimal part away instead of rounding, so you'll need to combine it with one more step. Your code will be tested with several different temperatures.
A cast to int always cuts the decimal part off. What could you add to the value first, so that anything with a decimal part of .5 or more ends up in the next whole number up?
Add 0.5, then cast the result: (int) (temperature + 0.5). The parentheses matter — (int) temperature + 0.5 casts first and adds after, which is a different (and wrong) calculation.