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, 22.06.2019 08:10
Alook-up table used to convert pixel values to output values on a monitor. essentially, all pixels with a value of 190 or above are shown as white (i.e. 255), and all values with a value of 63 or less are shown as black (i.e. 0). in between the pixels are scaled so that a pixel with a value p is converted to a pixel of value 2/127 −+3969). if a pixel has a value of 170 originally, what value will be used to display the pixel on the monitor? if a value of 110 is used to display the pixel on the monitor, what was the original value of the pixel?
Answers: 1
question
Computers and Technology, 22.06.2019 17:30
How do you make a lenny face? plz, brailiest to who can answer first.
Answers: 1
question
Computers and Technology, 23.06.2019 04:00
Laire writes a letter to her grandmother, in which she describes an amusement park she visited last week. she adds pictures of that place in her letter. which feature of a word processing program will claire to remove unwanted parts of the pictures?
Answers: 3
question
Computers and Technology, 23.06.2019 19:00
Now you’re on your own. include a short summary of this section with plots in your lab report. write a matlab script file to do steps (a) through (d) below. include a listing of the script file with your report. 1 the soundsc(xx,fs) function requires two arguments: the first one (xx) contains the vector of data to be played, the second argument (fs) is the sampling rate for playing the samples. in addition, soundsc(xx,fs) does automatic scaling and then calls sound(xx,fs) to actually play the signal. mcclellan, schafer, and yoder, dsp first, 2e, isbn 0-13-065562-7. prentice hall, upper saddle river, nj 07458. c 2015 pearson education, inc. 4 mcclellan, schafer and yoder, signal processing first. prentice hall, upper saddle river, new jersey, 2003. c 2003 prentice hall. (a) generate a time vector (tt) to cover a range of t that will exhibit approximately two cycles of the 4000 hz sinusoids defined in the next part, part (b). use a definition for tt similar to part 2.2(d). if we use t to denote the period of the sinusoids, define the starting time of the vector tt to be equal to t , and the ending time as ct . then the two cycles will include t d 0. finally, make sure that you have at least 25 samples per period of the sinusoidal wave. in other words, when you use the colon operator to define the time vector, make the increment small enough to generate 25 samples per period. (b) generate two 4000 hz sinusoids with arbitrary amplitude and time-shift. x1.t / d a1 cos.2
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, 05.05.2020 05:49
question
Mathematics, 05.05.2020 05:49
Questions on the website: 13722363