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

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

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

Post 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 16 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
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply