Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In c++, Please divide the program into weather.h file, weather.cpp and main.cpp. Solve the programming Challenge 4, Weather Statistics, Page# 659. Modify this problem by
In c++, Please divide the program into weather.h file, weather.cpp and main.cpp.
Solve the programming Challenge 4, Weather Statistics", Page# 659. Modify this problem by writing a class named Weather. Member variables: Total Rainfall, High Temperature, Low Temperature A default constructor with default value ZERO, and a constructor with three parameters A default destructor All member functions User input is not required, instead read data from a file, weather.txt (check next page). . Weather Statistics Write a program that uses a structure to store the following weather data for a par- ticular month: Total Rainfall High Temperature Low Temperature Average Temperature The program should have an array of 12 structures to hold weather data for an entire year. When the program runs, it should ask the user to enter data for each month. (The average temperature should be calculated.) Once the data are entered for all the Structured Data months, the program should calculate and display the average monthly rainfall, the total rainfall for the year, the highest and lowest temperatures for the year (and the months they occurred in), and the average of all the monthly average temperatures. Input Validation: Only accept temperatures within the range between -100 and +140 degrees Fahrenheit. Month High Temp (C) Low Temp (C) Avg Rain (mm): Jan 9.2 -46.4 43.4 Feb 5.6 -42.6 3.3 Mar 8.8 -39.6 2.7 Apr 16.4 -25.6 5.2 May 27.5 -6.7 35 Jun 31.3 -1.8 26.4 Jul 30.9 -0.3 65.6 Aug 31.6 -2 33.8 Sep 25.1 -7.7 23.2 Oct 18.6 -21.4 27.9 Nov 3.6 -12.7 0 Dec 10.3 -42.7 0Step by Step Solution
There are 3 Steps involved in it
Step: 1
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
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started