subject

Col 1 Col2 Col 3 Row 1 23.1 13.58 14
Row 2 56.783 46.29 45.71
Write a program that accomplishes the following objectives:
1. reads in the number of rows, then the number of columns,
2. using nested FOR loops, reads in the column data for each row,
3. adds up the data for each row and derives an average for each row,
4 also adds up all the data in the table and derives an overall average.
Hints
1. Look at slides 3 and 4 of CS1336_Lect5e_nested_loops. pptx and Pr5-14.cpp for samples of nested FOR loops, especially line 38 in slide 4 for a calculation of average per student. That is very much like a row average.
2 Have two running total variables, for example rowsum and totalsum. Initialize totalsum to 0 in the beginning of the program Initialize rowsum to 0 before the inner loop (see line 29 in slide 4). Keep running totals for both of these inside the inner loop (see line 36 in slide 4). Average the rowSum after each iteration of the inner loop (see line 38 in slide 4). Average the totalsum after the outside loop ends
When the input is as shown in Figure 1. your program should produce the output as shown in Figure 2.
Figure 1: (sample input) 23 23.1 13.58 14 56.783 46.29 45.71
Figure 2 (sample output) Lverage of data in row #1 is 16.89 Average of data in row #2 is 49.59 Average of all data is 33.24

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 24.06.2019 04:10
Write a program that reads a set of floating-point values. ask the user to enter the values, then print • the average of the values. • the smallest of the values. • the largest of the values. • the range, that is the difference between the smallest and largest. of course, you may only prompt for the values once.
Answers: 3
question
Computers and Technology, 24.06.2019 12:50
What percentage of teens plays video games? a.97% b.100% c.74% d.50%
Answers: 1
question
Computers and Technology, 24.06.2019 15:40
In the above figure, what type of cylinder arrangement is shown in the figure above? a. l-type b. v-type c. in-line d. horizontal pls make sure its right if its rong im grounded for 3months
Answers: 1
question
Computers and Technology, 26.06.2019 05:30
You use the save as dialog box to save a document in web page format.
Answers: 1
You know the right answer?
Col 1 Col2 Col 3 Row 1 23.1 13.58 14
Row 2 56.783 46.29 45.71
Write a program that ac...
Questions
question
Mathematics, 18.09.2019 15:00
question
Mathematics, 18.09.2019 15:00
question
Mathematics, 18.09.2019 15:00
question
Mathematics, 18.09.2019 15:00
question
Mathematics, 18.09.2019 15:00
Questions on the website: 13722363