![subject](/tpl/images/cats/informatica.png)
Computers and Technology, 09.04.2020 16:24 smilequi9653
Write a program that asks the user to enter the name of an input file. The program should read all the numbers from the given file and display the count, total, and average of all numbers in the following format (use three decimal digits for total and average):
Count: n
Total: .nnn
Average: .nnn
Requirements: You should assume that the file contains floating point numbers. Total and average should be properly formatted to display three decimal digits. If the file is empty, do not attempt to calculate the total and average, just display a message and exit the program. If the file does not exist, then display a message and allow the user to enter a new name.
View required output
Test Case 1
Standard Input Files in the same directory
double_input1.txt
double_input1.txt
double_input2.txt
double_input3.txt
Please enter the file name or type QUIT to exit:\n
Count: 100\n
Total: -5,748.583\n
Average: -57.486\n
Test Case 2
Standard Input Files in the same directory
double_input2.txt
double_input1.txt
double_input2.txt
double_input3.txt
Please enter the file name or type QUIT to exit:\n
Count: 2000\n
Total: 112,546.485\n
Average: 56.273\n
Test Case 3
Standard Input Files in the same directory
double_input4.txtENTER
double_input1.txt
double_input1.txt
double_input2.txt
double_input3.txt
Please enter the file name or type QUIT to exit:\n
File: double_input4.txt does not exist.\n
Please enter the file name again or type QUIT to exit:\n
Count: 100\n
Total: -5,748.583\n
Average: -57.486\n
Test Case 4
Standard Input Files in the same directory
double_input3.txt
double_input1.txt
double_input2.txt
double_input3.txt
Please enter the file name or type QUIT to exit:\n
File double_input3.txt is empty.\n
![ansver](/tpl/images/cats/User.png)
Answers: 1
Another question on Computers and Technology
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 16:00
To fill (copy) a cell across or down, point to the of the cell and drag. top left corner top right corner bottom left corner bottom right corner
Answers: 3
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 24.06.2019 22:30
To add additional commands to the quick access toolbar, a user can navigate to the view. backstage status bar design file
Answers: 2
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 25.06.2019 00:00
Rom is designed for computer instructions temporary storage of data processing data
Answers: 1
![question](/tpl/images/cats/informatica.png)
Computers and Technology, 25.06.2019 03:10
Write a program to convert a person's height in inches into centimetres #and their weight in stones into kilograms. (1 inch = 2.54 cm and 1 stone = 6.364 kg)
Answers: 1
You know the right answer?
Write a program that asks the user to enter the name of an input file. The program should read all t...
Questions
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/User.png)
![question](/tpl/images/cats/User.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/en.png)
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/fr.png)
French, 26.01.2022 08:00
![question](/tpl/images/cats/mat.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 26.01.2022 08:00
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/biologiya.png)
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/himiya.png)
![question](/tpl/images/cats/User.png)
SAT, 26.01.2022 08:00
![question](/tpl/images/cats/obshestvoznanie.png)
Social Studies, 26.01.2022 08:00
![question](/tpl/images/cats/ekonomika.png)
![question](/tpl/images/cats/mat.png)
Mathematics, 26.01.2022 08:00