Question
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started