Modify the Rainfall Statistics program you wrote for Programming Challenge 2 of
ID: 3535492 • Letter: M
Question
Modify the Rainfall Statistics program you wrote for Programming Challenge 2 of Chapter 7. The program should display a list of months, sorted in order of rainfall, from highest to lowest.
Prompts And Output Labels. See Programming Challenge 2 in Chapter 7. In addition, the program should print for each month a line of this form: "R inches in M" where R is the inches of rainfall for month M. These lines should be in ascending order based on the value of R.
Explanation / Answer
#include #include #include using namespace std; // Structs are useful for combining related data. struct Month { enum { JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC, NUM_MONTHS }; const char *name; int rainfall; Month(const char *name) { this->name = name; rainfall = 0; } bool operatorrainfall); return 0; }Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.