Question: please write a C program includes #include Observe the usual guidelines regarding the initial comment section, indenting, and so on. In addition, when functions are
please write a C program includes
#include
Observe the usual guidelines regarding the initial comment section, indenting, and so on. In addition, when functions are required, place function definitions following main. At the beginning of the program and before each function use comments to explain what the function does. Do not use global variables.
2. Yearly rainfall data for four weather stations in a certain county is recorded in the table below.
County Rainfall in Inches
| Station | 2005 | 2006 | 2007 | 2008 | 2009 | 2010 |
| 1 | 39.4 | 45.6 | 42.3 | 44.7 | 37.3 | 41.6 |
| 2 | 41.0 | 47.2 | 43.8 | 42.0 | 36.9 | 38.2 |
| 3 | 38.1 | 47.9 | 42.9 | 43.6 | 36.2 | 42.8 |
| 4 | 41.8 | 46.5 | 44.1 | 45.0 | 38.1 | 43.3 |
Initialize at declaration a double subscripted array of doubles with the rainfall data at the four stations for the six years shown. It may also be convenient to initialize an array of years and an array of station numbers.
Call a function to find the average rainfall for each year. Function parameters will include the two-dimensional array of rainfall data and the one-dimensional array of yearly averages. The number of rows and columns in the array may be defined as symbolic constants or may be passed as array parameters.
Call a second function to find the average rainfall in the county for the 6-year period. Return the overall average pass by value. The array of rainfall data will be a function parameter. The number of rows and columns in the array may be defined as symbolic constants or may be passed as array parameters.
Call a third function to print the labeled table of rainfall data, the yearly averages, and the overall average. Print the yearly averages directly below the column data for the appropriate year. Determine with an if statement the years in which the rainfall was above the overall average; then print.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
