Question

In: Computer Science

hello! this is my C++ ASSIGNMENT. Pls my professor is very delicate when it comes to...

hello! this is my C++ ASSIGNMENT. Pls my professor is very delicate when it comes to grading. I am beginner, if you can please provide me with comments I will appreciate it!!

The Weather Service Bureau department has data representing monthly rainfall for a year and we would like to create a table categorizing each month as rainy (rainfall 20% higher than average) dry (rainfall 25% lower than average) or average. The data file for monthly rain fall is called rainfall.txt.

rainfall.txt

95
100
120
130
135
145
155
185
190
160
130
120

Store the data file in the same folder of your lab6.cpp.
Output
The year's average monthly rainfall was 139 mm.
September has the highest rainfall (190 mm).
January has the lowes rainfall (95 mm)
Month      Rainfall(mm)   Classification
-------      ---------------      --------------
    
1                   95                   Dry
    2                 100                   Dry
    3                 120               Average
    4                 130               Average
    5                 135               Average
    6                 145              Average
    7                 155              Average
    8                 185                Rainy
    9                 190                Rainy
10                 160             Average
11                 130             Average
12                 120             Average

Program Requirements:
Implement the following functions in the program:


void inputRainfall(int rainFal l[], int size)
The function reads the monthly rainfall from the file rainFall.txt and stores them in the array rainFall
int calculateAverageRainFall(int rainFall [], int size)
Return the average monthly rainfall
void classifyAndDisplayRainfall(int rainFall[], int months);
Classify and display each month as average, rainy, or dry.

Solutions

Expert Solution

Please find the program to calculate the monthly rainfall statistics in cpp.

Program:

Output:

The year's average monthly rainfall was 139 mm.
September has the highest rainfall (190 mm).
January has the lowest rainfall (95 mm).
Month Rainfall(mm) Classification
------- --------------- --------------
1 95 Dry
2 100 Dry
3 120 Average
4 130 Average
5 135 Average
6 145 Average
7 155 Average
8 185 Rainy
9 190 Rainy
10 160 Average
11 130 Average
12 120 Average

Screen Shot:


Related Solutions

hello!! So this is my CIS assignment, my professor is very hard to understand and he...
hello!! So this is my CIS assignment, my professor is very hard to understand and he expects us to be perfect lol. I have tried to run this problem with a code but as you can see he wants to see that when the program is ran, all of the outcomes are listed all at once, the code that I have does meet the math part when it comes to the answers but as I said it does not show...
Validating Input file, So for my C++ assignment, my professor says we need to validate the...
Validating Input file, So for my C++ assignment, my professor says we need to validate the Input File, Which means, if the line is missing a comma, one of the 3 information, or the string is a white line, it will ignore it. If the line has a white line, the program will correct it and will read in the line. I will store these into an Array, and display them in First name, Last name, and Number of Votes...
Checking Input File for correct line format. So for my C++ assignment, my professor says we...
Checking Input File for correct line format. So for my C++ assignment, my professor says we need to validate the Input File, if there are white lines and spaces, in which it will ignore them, separated by a comma, and that all data items are there. This will be used in a program where i will store these into an Array, and display them in First name, Last name, and Number of Votes. This is a sample of the txt...
Checking Input File for correct line format. So for my C++ assignment, my professor says we...
Checking Input File for correct line format. So for my C++ assignment, my professor says we need to validate the Input File, if there are white lines and spaces, in which it will ignore them, separated by a comma, and that all data items are there. This will be used in a program where i will store these into an Array, and display them in First name, Last name, and Number of Votes vertical columned categories. This is a sample...
Hello i am working on an assignment for my programming course in JAVA. The following is...
Hello i am working on an assignment for my programming course in JAVA. The following is the assignment: In main, first ask the user for their name, and read the name into a String variable. Then, using their name, ask for a temperature in farenheit, and read that value in. Calculate and print the equivalent celsius, with output something like Bob, your 32 degrees farenheit would be 0 degrees celsius Look up the celsius to farenheit conversion if you do...
Employees can be very satisfied when it comes to compensation when they feel they are respected...
Employees can be very satisfied when it comes to compensation when they feel they are respected for their performance by offering a higher salary. You provided great research in your information and have excellent information to support your thoughts. When you were researching your information, do you feel there is a difference better upper level employees and line managers, and line employees when it comes to motivating employees with compensation? How does compensation affect the attitude of employees in the...
The concepts of reliability and validity are very important when it comes to the testing of...
The concepts of reliability and validity are very important when it comes to the testing of intellectual abilities. When tests are given such importance (in terms of how we look at and use the numbers), they must be carefully constructed to be as accurate as possible. Could a test of intelligence be reliable, but not valid? How? Could some other measure (assessing something other than intelligence) be valid, but NOT reliable? Why or why not? Give examples. Of what practical...
PLEASE WORK THE PROBLEM STEP BY STEP. MY PROFESSOR IS A VERY HARD GRADER ALWAYS WANT...
PLEASE WORK THE PROBLEM STEP BY STEP. MY PROFESSOR IS A VERY HARD GRADER ALWAYS WANT STUDENT SHOW WORK. Sanders Corporation operates a factory in Arizona. Due to a change in business climate an impairment test is deemed appropriate. Management has acquired the following information: Cost $243,000,000 Accumulated depreciation 112,000,000 Estimate of the total undiscounted future cash flows 110,000,000 Present value of estimated future cash flows 94,000,000 Estimated fair value of the Arizona factory, as appraised 90,000,000 Required: a) Determine...
Hello, I am having difficulty with this assignment. I chose Amazon as my stock, but I...
Hello, I am having difficulty with this assignment. I chose Amazon as my stock, but I am confused on what they're asking :             Choose a stock that interests you. Utilizing Bloomberg (or other financial websites) as a source of data, collect the following      information:                         a. The stock’s Beta                         b. The rate of return on the market (S&P 500 Index)                         c. The risk-free rate (rRF)                         d. The last dividend paid (D0)...
Hello this is for C++ language. I am currently stuck on creating my api for Day...
Hello this is for C++ language. I am currently stuck on creating my api for Day Trading Stocks. as follows I need an api for *//Function Signature * * parameter: * * Return Value: ** *// Write the following function taking in an integer vector (vector &prices) consisting of all prices, in chronological order, for an hypothetical instrument. Your function recommends the maximum profit an investor can make by placing AT MOST one buy and one sell order in the...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT