Question
Can somone help me make a program that generates a list of random integers and outputs them to a file named randomNumbers.txt.Then the program opens
Can somone help me make a program that generates a list of random integers and outputs them to a file named "randomNumbers.txt".Then the program opens the le "randomNumbers.txt" as the input file, reads all the numbers from the file, and outputs the largest/smallest numbers and the average of all the numbers to the screen.
The "randomNumbers.txt" file contains nothing but numbers of type int separated by blanks and/or line breaks. You can choose the size of the list and the range of the random numbers. You will need to create one or more test files in order to test your program
The program should display the largest and smallest numbers, and the average of all the numbers to the screen.
Hints: the program should calculate the followings:
- The number of numbers in the le
- The largest and smallest numbers
- The sum of all the numbers in the le (a running total)
The average of all the numbers in the le
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started