Question: C++ need help solving this without using classes. We've only covered functions and arrays. Write a C++ program to total each individual row and each
C++ need help solving this without using classes. We've only covered functions and arrays.
Write a C++ program to total each individual row and each individual column of a two dimensional array consisting of 10 rows and 6 columns using a single nested loop to accomplish this task. Use a random number generator to store integers in the range of 1 to 100 in the array. The program should utilize at least three functions. A function to initialize the array using random numbers, a function to compute the totals of each row and column (hint: use one dimensional arrays as accumulators), and another function to display the two dimensional array and the sums of each row and column. Below is an example of a 10 by 6 array displaying the required output of the program. NOTE: This is an example only.
| 1 | + | 2 | + | 3 | + | 4 | + | 5 | + | 6 | = | 21 |
| 2 | + | 4 | + | 6 | + | 7 | + | 5 | + | 6 | = | 30 |
| 3 | More values not included | |||||||||||
| 4 | ||||||||||||
| 5 | ||||||||||||
| 6 | ||||||||||||
| 7 | ||||||||||||
| 8 | ||||||||||||
| 9 | ||||||||||||
| 10 | ||||||||||||
| 55 | ||||||||||||
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
