Answered step by step
Verified Expert Solution
Link Copied!

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... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Document Format ( 2 attachments)

PDF file Icon
6642f777eed9c_969833.pdf

180 KBs PDF File

Word file Icon
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

Recommended Textbook for

Mobile Communications

Authors: Jochen Schiller

2nd edition

978-0321123817, 321123816, 978-8131724262

More Books

Students also viewed these Programming questions

Question

What are the monitoring and control for Nexus Crdiac case study

Answered: 1 week ago

Question

Identify several key elements in the evaluation of solvency.

Answered: 1 week ago