Question: Please write the program in C++, the main function is provided and should not be changed. Please fill in the class declaration and implementation and
Please write the program in C++, the main function is provided and should not be changed. Please fill in the class declaration and implementation and any other stuff to make the program work. Thanks!


Main Function provided :
// Chapter 8 - Programming Challenge 12, Stats Class and Rainfall Statistics // This program revises Programming Challenge 8 to create and use a Stats class // that contains general statistical functions. It will use it to store monthly // rainfall data and to report rainfall statistics. The Stats class is defined // in this same file as the client program that uses it. You may wish to have // students use a separate file for the Stats class. #include #include #include using namespace std; // ************** Place class declarations and implementation here ****************** //*************************** user program ***************************** // Function prototype void storeData(Stats &); void rainReport(const Stats &); const int NUM_MONTHS = 12; // The number of months of data // being input and analyzed const string monthName[] = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November ", "December "}; int main() { Stats rainfall; // Create an instance of the Stats class // to store and manage the rainfall data storeData(rainfall); rainReport(rainfall); return 0; } /*************************************************************** * storeData * * Accepts inputs and sends them to the Stats object to store. * ***************************************************************/ void storeData(Stats &rainfall) { double rain; for (int month = 0; month > rain; while (rain > rain; } // Send it to the Stats object to store rainfall.storeValue(rain); } } /************************************************************* * rainReport * * Displays a report of rainfall statistics. * *************************************************************/ void rainReport(const Stats &rainfall) { // Print a report heading cout 12. Stats Class and Rainfall Statistics Create a Stats class whose member data includes an array capable of storing 30 double data values, and whose member functions include total, average, lowest, and highest functions for returning information about the data to the client program. These are general versions of the same functions you created for Programming Challenge 8, but now they belong to the Stats class, not the application program. In addition to these functions, the Stats class should have a Boolean storeValue function that accepts a double value from the client program and stores it in the array. It is the job of this function to keep track of how many values are currently in the array, so it will know where to put the next value it receives and will know how many values there are to process when it is carrying out its other functions. It is also the job of this function to make sure that no more than 30 values are accepted. If the storeValue function is able to successfully store the value sent to it, it should return true to the client program. However, if the client program tries to store a thirty-first value, the function should not store the value and should return false to the client program. The client program should create and use a Stats object to carry out the same rainfall analysis requested by Programming Challenge 8. Notice that the Stats object does no I/O. All input and output is done by the client program Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
