Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

The Ages Of The Investor A Critical Look At Life Cycle Investing

Authors: William J Bernstein

1st Edition

1478227133, 978-1478227137

Students also viewed these Databases questions