Answered step by step
Verified Expert Solution
Link Copied!

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 Files-Numeric 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 5-
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, 6) 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 2-digit in decimal.
The output should display in a nice look table format
** Hint: To display every 20 numbers in a line, use a counter recorded how many numbers been read. if (counter %20==0) print a new line in the output
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Logidata+ Deductive Databases With Complex Objects Lncs 701

Authors: Paolo Atzeni

1st Edition

354056974X, 978-3540569749

Students also viewed these Databases questions

Question

Explain the necessity of supervision over fixed assets.

Answered: 1 week ago

Question

An improvement in the exchange of information in negotiations.

Answered: 1 week ago