Answered step by step
Verified Expert Solution
Question
1 Approved Answer
C++ Programming Question 2: Largest Smallest of File Write a program that generates a list of random numbers of type double and output to a
C++ Programming
Question 2: Largest Smallest of File Write a program that generates a list of random numbers of type double and output to a file named randoms.txt. Then opens the file random.txt, takes its input from the file of numbers of type double and outputs the largest and the smallest number found in the file to the screen. The program reads all the numbers from the file, and calculates the following: A) The number of numbers in the file B) The sum of all the numbers in the file (a running total) C) The average of all the numbers in the file The file contains nothing but numbers of type double separated by blanks and/or line breaks. 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. # of numbers found in the file, the sum of the numbers, and the average of the numbers. Set up the output formatting to two digits after the decimal pointStep 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