please answer all questions You need to generate a (5x12) rain matrix (Rain[5][12]) that contains the average rainfall over 12 months for a 5 year period.  You program should do the following steps: 1)     Create a 5x12 integer rainfall matrix 2)     Create a 5 element array of int pointers(int * Rain[5]) and assign each pointer to the address of the first element of each row 3)     Populate the elements of the matrix with pseudo-random numbers having a range from 0-100  inches.  Use the rand( ) function to generate your temperatures.  The output of rand() should be mod with 100 (rand()%100) in order to get reasonable rainfall values.      Init the random number generator with long seed = srand(67)     This task should be performed by a function, void RainGen(int* Rain[ ], int R, int C), that populates all the matrix entries. 4)     After generating all rainfall matrix entries, print the entire matrix using the function, void Print(int* Rain[ ], int R, int C); 5)     Calculate the total  monthly Rainfall  per year for the entire five years. Use the following function, int Year(int * Rain[], int C); 6)      Print the  total yearly sum 7)     Calculate the  total  monthly rainfall for the entire five years  by using the following function, int Month(int *ptr, int R, int C);     Where ptr = &Rain[0][0] 8)     Print the  total

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter7: Arrays
Section7.1: One-dimensional Arrays
Problem 10E: (Electrical eng.) Write a program that specifies three one-dimensional arrays named current,...
icon
Related questions
Question

please answer all questions

You need to generate a (5x12) rain matrix (Rain[5][12]) that contains the average rainfall over 12 months for a 5 year period.  You program should do the following steps:

1)     Create a 5x12 integer rainfall matrix

2)     Create a 5 element array of int pointers(int * Rain[5]) and assign each pointer to the address of the first element of each row

3)     Populate the elements of the matrix with pseudo-random numbers having a range from 0-100  inches.  Use the rand( ) function to generate your temperatures.  The output of rand() should be mod with 100 (rand()%100) in order to get reasonable rainfall values. 

  1.     Init the random number generator with long seed = srand(67)
  2.     This task should be performed by a function, void RainGen(int* Rain[ ], int R, int C), that populates all the matrix entries.

4)     After generating all rainfall matrix entries, print the entire matrix using the function, void Print(int* Rain[ ], int R, int C);

5)     Calculate the total  monthly Rainfall  per year for the entire five years. Use the following function, int Year(int * Rain[], int C);

6)      Print the  total yearly sum

7)     Calculate the  total  monthly rainfall for the entire five years  by using the following function, int Month(int *ptr, int R, int C);

  1.     Where ptr = &Rain[0][0]

8)     Print the  total

Expert Solution
steps

Step by step

Solved in 4 steps with 3 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning