Question: (15 points) Write a complete C++ program that uses a while loop and if...else chain to process a collection of daily temperatures in Celsius.
(15 points) Write a complete C++ program that uses a while loop and if...else chain to process a collection of daily temperatures in Celsius. Your program should continuously read temperatures from the user until he/she enters 0. Your program should count and print the number of hot days (temperature 30 or higher), the number of pleasant days (temperature 18-29) and the number of cold days (temperature less than 18). When the user enters 0, your program should terminate and display the total number of hot days, pleasant days and cold days. Sample Run Please enter a temperature: 35 Please enter a temperature: 12 Please enter a temperature: 23 Please enter a temperature: 28 Please enter a temperature: 0 You have entered 1 hot day(s), 2 pleasant day(s) and 1 cold day(s).
Step by Step Solution
There are 3 Steps involved in it
Heres a C program that implements the functionality you described include iostream int main in... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (2 attachments)
6642f777eed9c_969833.pdf
180 KBs PDF File
6642f777eed9c_969833.docx
120 KBs Word File

