Question: ----- C++ ----- it had to look like the box below. Please and thank you so much! Lab 2 Assignment L2-6 In this exercise, you
Lab 2 Assignment L2-6 In this exercise, you are to modify the Classified Numbers programming example in this chapter. As written, the program inputs the data from the standard input device (keyboard) and outputs the results on the standard output device (terminal screen). The program can process only 20 numbers. Rewrite the program to incorporate the following requirements: a) Data to the program is input from a file of an unspecified length named Ch6_Ex20Data.txt; that is, the program does not know in advance how many numbers are in the file. b) Save the output of the program in a file named Ch06_Ex200ut.txt. c) Modify the void function getNumber so that it reads a number from the input file (opened in the function main), outputs the number to the output file (opened in the function main), and sends the number read to the function main. Print only 10 numbers per line. Assume all numbers are between - 9999 and 9999. d) Have the program find the sum and average of the numbers. e) Modify the function printResult so that it outputs the final results to the output file (opened in the function main). Other than outputing the appropriate counts, this new definition of the function printResult should also output the sum and average of the numbers. CAUsers Johnl source repos\L2-6/Debug L2-6.exe John Urrutia L2-6 L2-6.exe processing Data There are 27 evens, which includes 12 zeros Total number of odds are: 16 The sum of numbers = 558 The average is 12 Press any key to Exit.. s Developer Command Prompt for VS 2019 - X C:Users\JohnU\source epos \L2-6>type L2-6Data.txt 43 67 82 0 -87 @ 12 2-64 -2 -8 4 23 12 62 100 101 -203 -340 500 23 76 C:\Users\JohnU\source epos \L2-6). M00
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
