Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Using Files - Numeric Processing Download the text file, Random.txt darr, from the demo file folder on Canvas. This file contains a long list of
Using FilesNumeric Processing
Download the text file, Random.txt darr, from the demo file folder on Canvas. This file contains a long list of random whole numbers within
digit. Copy the file to your hard drive where the working directory of the IDE you use Write a program that opens the file, reads all the number:
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 largest number from all numbers in the file
The smallest number from all numbers in the file
Requirements:
The program should prompt a message to ask for the name of a text file to process. Display an error message if the file can't be
found.
The output should display all numbers found in the file, set a fixed space for example, for each number, and every twenty
numbers in one line.
Summarize the number of numbers found in the file, the sum of the numbers, and the average of the numbers in a table format.
The average should be displayed in digit in decimal.
The output should display in a nice look table format
Hint: To display every numbers in a line, use a counter recorded how many numbers been read. if counter print a new line in the output
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