(15 points) Write a complete C++ program that uses a while loop and if...else chain to...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(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). (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).
Expert Answer:
Answer rating: 100% (QA)
Heres a C program that implements the functionality you described include iostream int main in... View the full answer
Posted Date:
Students also viewed these programming questions
-
Compute the left regular representation of Z 4 . Compute the right regular representation of S 3 using the notation of Example 8.7. Data from Example 8.7. An interesting example for us is the group...
-
What are the monitoring and control for Nexus Crdiac case study
-
Question: Old MathJax webview Old MathJax webview i need ans of these question but the source is alot Old MathJax webviewOld MathJax webview i need ans of these question but the source is alot these...
-
Calculate the following ratios from the data given below: 1. Debt ratio 2. Debt service coverage multiples 3. Interest coverage Balance Sheet 12/31/2014 Assets Cash..$575,000 Short-term...
-
How does a pizza shops Procurement process differ from CBIs? What do you believe is the corporate strategy of your favorite pizza franchise? What are the objectives and measures of its Procurement...
-
Lianas are woody vines that grow in tropical forests. Researchers measured liana abundance (stems/ha) in several plots in the central Amazon region of Brazil. The plots were classified into two...
-
Can you multiply a P/E ratio by the EBIT to get the equity value?
-
In January 2010, Cordova Company entered into a contract to acquire a new machine for its factory. The machine, which has a cash price of $215,000, was paid for as follows: Down payment...
-
q24 --Jasper Company applies overhead on the basis of direct labor cost. At the beginning of January, Jasper estimated its manufacturing overhead costs for the year to be $100072 and its direct labor...
-
In the past 15-20 years, school shootings involving teenage perpetrators have raised a lot of questions about how these teenagers could be responsible for such terrible violence. Based on your...
-
The following data show the household pets that people own: F = fish, D = dog, B = bird, C = cat, and R = reptile. Construct a categorical frequency distribution for the data and summarize the...
-
What are the two types of working paper files?
-
What is a brake?
-
Name eight examples of risk that management should identify and control.
-
When auditing individual accounts and disclosures, an auditor's objective is to determine the validity of management's a. Calculations. b. Recording process. c. Assertions. d. Internal control.
-
Ensuring the Going Concern of XYZ Enterprises XYZ Enterprises, a well-established company, is facing economic challenges in the market, leading to concerns about its ability to continue operations as...
-
KD Insurance Company specializes in term life insurance contracts. Cash collection experience shows that 20 percent of billed premiums are collected in the month before they are due, 60 percent are...
-
Supreme Videos, Inc.. produces short musical videos for sale to retail outlets. The company's balance sheet accounts as of January 1. the beginning of its fiscal year, are given below. Required: 1....
-
Selected ledger accounts of Moore Company are given below for the just completed year: Raw Materials Manufacturing Overhead Bal. 1/1 Debits 15,000 Credits 120,000 110,000 Debits 230,000 Credits...
-
Why is activity-based costing growing in popularity?
Study smarter with the SolutionInn App