Question: C++ #include #include 6.11 LAB: Files (input and output) This program writes data to a file, then uses the same file to read data from

C++

#include #include

C++ #include #include 6.11 LAB: Files (input and output) This program writes

6.11 LAB: Files (input and output) This program writes data to a file, then uses the same file to read data from it. Generates n random numbers within a given range, displays them to the screen, and writes them to a file. Reads the numbers from the file, displays them to the screen, and calculates their average. Displays the average of the random numbers. Finish the program following the specifications given as comments in the program. Note: The call for srand has been omitted on purpose, to make sure that your output matches zyBook's output. Because there is no call for srand(), each time you run the program, it will generate the same random numbers. If you run this program on your own computer or use the online compiler, you are more likely going to get different numbers than the zyBook's numbers, because of the way random numbers are generated. For instance, when input is 8, the zyBook's solution generates the following random numbers: -15 24 -16 9 7 12 12 23 When I run the program on my computer I got: 6 0 -20 -23 -3 -17 -1 1 When I run the program using the online C++ compiler I got: -69 -16 -18 -20 -18 -15 -13 293630.1715672

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To complete this program we need to Generate a specified number of random numbers Write these number... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!