Answered step by step
Verified Expert Solution
Question
1 Approved Answer
(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
Step: 1
Heres a C program that implements the functionality you described include iostream int main in...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Document Format ( 2 attachments)
6642f777eed9c_969833.pdf
180 KBs PDF File
6642f777eed9c_969833.docx
120 KBs Word File
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started