Page 1 of 1

Design the Weather class (in files Weather. h and Weather. cpp ) that contains the following members: Data members to st

Posted: Thu Jul 14, 2022 2:28 pm
by answerhappygod
Design The Weather Class In Files Weather H And Weather Cpp That Contains The Following Members Data Members To St 1
Design The Weather Class In Files Weather H And Weather Cpp That Contains The Following Members Data Members To St 1 (581.69 KiB) Viewed 17 times
Design the Weather class (in files Weather. h and Weather. cpp ) that contains the following members: Data members to store: - a day (an integer) - a month (an integer) - a year (an integer) - a temperature (a float) - a static data member that stores the total of all temperatures (a float) Member functions: - a constructor function that obtains a day, month, year and temperature from the user. This function should also accumulate/calculate the total of all temperatures (i.e., add the newly entered temperature to the total). - a static function that computes and displays the day which has the lowest temperature. Note: An array of Weather objects and the size of the array will be passed to this function. - a static function that computes and displays the average temperature. This function should use a parameter, if necessary. Design the main ( ) function, which instantiates/creates any number of objects of the Weather class as requested by the user (i.e., creates a dynamic array of Weather objects). main ( ) should also call appropriate functions to compute and display the day that has the lowest temperature, as well as the average temperature. Your program should include all necessary error checking. A sample run of this program could be as follows: How many days =4 Enter day, month, year, temperature =>2911201815.6 Enter day, month, year, temperature =>301120188.7 Enter day, month, year, temperature =>11220183.1 Enter day, month, year, temperature =>21220183.5 Lowest temperature =3.1C, Day 1/12/2018 Average temperature =7.7C