Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

If you have downloaded this book\'s source code from the companion Web site, you

ID: 3779051 • Letter: I

Question

If you have downloaded this book's source code from the companion Web site, you will find a find a file named Random.txt in the Chapter 05 folder. (The companion Web site is at www. Pearsonhighered.com/gaddis.) This file contains a long list of random numbers. Copy the file to your hard drive and then write a program that opens the file, reads all the numbers from the file, and calculates the following: The number of numbers in the file The sum of all the numbers in the file (a running total) The average of all the numbers in the file The program should display the numbers of numbers found in the file, the sum of the numbers, and the average of the numbers. Prompts And Output Labels. Print each of the above quantities on a line by itself, preceding by the following (respective) labels: "Number of numbers:", Sum the numbers: ", and "Average of the numbers:"

Explanation / Answer

average_of_numbers=(sum_of_numbers/count);

//can also use

//average_of_numbers=(sum_of_numbers/numbers.size());

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote