Я студент, учусь на ИТ, дали программу написать, помогите пожалуйста написать ее.
Она на английском(тем кто не шарит в английском прошу воспользоваться переводчиком, времени мало до 20 числа этого месяца)
Вот собственно и программа: CSCI114_Autumn2011_Assignments_Assignment_1.doc
Problem 1: Rainfall Prediction
Your program needs to read in the data for ten years of rainfalls and then calculate a 3-year running average and based on this 3-year running average predict the average rainfall of next year. If the difference between the predicted value and the average of the 3-year running averages is higher than one standard deviation then take the reduce the prediction to the one standard deviation from the average.
For example: let’s say the rainfall in last 10 years have been:
year 1 2 3 4 5 6 7 8 9 10 prediction
rainfall 10 20 15 18 5 6 7 15 13 16
3-year average 15 17.67 12.67 9.67 6 9.34 11.67 14.67
Average of 3-year averages= 11.72
Standard deviation = 3.86
Prediction = 14.67
If (prediction – average) > standard deviation then
prediction = average + standard deviation
Prediction is correct.
14.67 – 11.72 = 2.95 therefore the prediction= 14.67 is correct.
If for example the prediction were 17.00 then
17 – 11.72 = 5.28
Then the prediction would have been prediction= 11.72+3.86= 15.58
Your program need to:
• The main has be simple and only contain function calls
• Write a function to ask user to input the rainfall amounts and store them in an array.
• Write a function to take the rainfall array and calculate the 3-year averages and store them in another array.
• Write a function to calculate average and standard deviation.
• Write a function to test the value of prediction and return the correct value of prediction.
• Write a function to output the rainfall values in columns with appropriate titles
• Write a function to output the 3-year averages with appropriate titles
• Write a function to output the prediction for next year
• Write the main to use the above functions.
• The main and all function should have proper comments.