Question
Create a program that reads a file called numbers.txt which contains an unknown quantity of integers. Your program should do the following with the data:
Create a program that reads a file called numbers.txt which contains an unknown quantity of integers. Your program should do the following with the data:
Calculate the sum of all numbers in the file
Calculate the average of all the numbers in the file
Determine the smallest number in the file
Determine the largest number in the file
Your program must print the results in a new file called results.txt. The contents of this file should be four (4) sentences displaying the results.
Example output:
The sum is 83747 The average is 198 The smallest is 4 The largest is 98
*** Should be in JAVA*****
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