Question: Write a C++ program that calculates the weekly average temperature for your area. Please create a column of 7 day names + 7 daily average
Write a C++ program that calculates the weekly average temperature for your area. Please create a column of 7 day names + 7 daily average temperatures (in F or C degrees), ending with the number -999. Then, create a C++ program that accepts the input, and calculates the weekly average of the 7 (or any number of) daily temperatures.
Use the While statement to input the row of temperatures and store the sum of those temperatures. Then, calculate and display the average of those temperatures.
The requested screen displayand a sample run of datamight be as follows (user input in bold):
| Weekly Average Temperature Calculator -------------------------------------------------- Please enter a column of 7 day names & daily average temperatures, ending with the number -999: Mon 57 Tues 63 Wed 60 Thurs 65 Fri 62 Sat 55 Sun 57 -999 Based on these values, the weekly average temperature is: 59.9 |
I have seen code like this ,which works,
#include
int main(){ string weeks[] = {"","Mon","Tues","Wed","Thurs","Fri","Sat","Sun"}; cout<<"Weekly Average Temperature Calculator"< ****although it works , and I can learn a lot from it. It is a bit too far advanced for what we have learned so far. we have yet to tackle strings. I need help with it from a c++ 101 perspective.. longer code is ok as its easier to learn from for myself as we are learning functions t ocover this material. thank you for all your time****
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
