### How do I find the Averages for this program?

Hello, I am very new to programming and I am currently taking a c++ class. The task was to Write a program that asks the user for rainfall values for each month of a year, one month at a time. The program should then calculate the average monthly rainfall (or snowfall) for the whole year, and then, for each month, print out a line saying how much the rainfall for that month was above or below the average (negative numbers for lower values are fine).

I have written the code below but I have no idea how to even find the above or below averages. If someone can help me understand, I would greatly appreciate it!

 ``12345678910111213141516171819202122232425`` ``````#include #include #include #include using namespace std; string get_rain_value(string month) { cout << "Enter the rainfall value for " << month << ": "; string answer; cin >> answer; return answer; } int main() { vector months = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; vector rain_values; for (string month: months) { rain_values.push_back(get_rain_value(month)); } cout << endl; for (int i = 0; i < months.size(); i += 1) { string start = rain_values[i]; cout << "Rainfall value for " << months[i] << " was " << start << endl; } }``````
Last edited on
Are the rainfall values really words? Was the rainfall for January "Unusually low" or 42?