Question: Write an if / else if / else statement that increments coldDays if currentTemperature is less than 1 0 deg C , increments moderateDays

Write an if/else if/else statement that increments coldDays if currentTemperature is less than 10\deg C, increments moderateDays if currentTemperature is between 10\deg C and 25\deg C, and increments hotDays if currentTemperature is above 25\deg C. Assume coldDays, moderateDays, hotDays, and currentTemperature are all declared and initialized variables.
Additionally, if the weather is very cold (0C or less), print a message stating "Warning! Chance of icy roads, drive carefully.". If the weather is very hot (30C or more), print a message stating "Warning! Hot weather, stay hydrated and stay indoors during the hottest hours.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!