Modify example program 2 to average four numbers read from a list.
Add a fourth value to the data list
Replace DO WHILE count < 3 with DO WHILE count < 4
The modified program is:
Data List: 10, 15, 20, 25
LET sum = 0
LET count = 0
DO WHILE count < 4
INPUT num
LET sum = sum + num LET count = count + 1
LOOP
LET average = sum / count OUTPUT average
Computer Science & Information Technology
You might also like to view...
Which of the following is true about overlapping subproblems?
a. Same subproblem is solved repeatedly b. It creates duplicate elements c. It prevents the problem from being divided d. It requires recursion
Computer Science & Information Technology
The JavaScript function for receiving input is ____.
A. Declare B. prompt() C. var D. document.write()
Computer Science & Information Technology
A virus can infect a Flash BIOS
Indicate whether the statement is true or false
Computer Science & Information Technology
?Apple was a pioneer in user interface development, introducing the _____, complete with mouse and screen icons, in the early 1980s.
A. ?command line interface B. ?binary line interface C. ?character user interface D. ?graphical user interface
Computer Science & Information Technology