Write a program that prompts the user for a file name, then reads that file (assuming that its contents consist entirely of integers) and prints the maximum, minimum, sum, count (number of integers in the file), and average of the numbers. For example, if the file num_input.dat has the following contents: 4 -2 18 15 31 27 Your program would produce the following output: What is the name of the input file? numberinput.dat Maximum = 31 Minimum = -2 Sum = 93 Count = Average = 15.5
Write a program that prompts the user for a file name, then reads that file (assuming that its contents consist entirely of integers) and prints the maximum, minimum, sum, count (number of integers in the file), and average of the numbers. For example, if the file num_input.dat has the following contents: 4 -2 18 15 31 27 Your program would produce the following output: What is the name of the input file? numberinput.dat Maximum = 31 Minimum = -2 Sum = 93 Count = Average = 15.5
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
Related questions
Question
100%
Write the java program that will prdoce the output below
![a. Write a program that prompts the user for a file name, then reads that file
(assuming that its contents consist entirely of integers) and prints the maximum,
minimum, sum, count (number of integers in the file), and average of the
numbers. For example, if the file num_input.dat has the following contents:
4 -2 18
15 31
27
Your program would produce the following output:
What is the name of the input file? numberinput.dat
Maximum = 31
Minimum = -2
Sum = 93
Count =
6
Average = 15.5](/v2/_next/image?url=https%3A%2F%2Fcontent.bartleby.com%2Fqna-images%2Fquestion%2F5b66c8cf-8fea-4da9-aad3-47e01c95751e%2F06330efa-d524-43a0-b936-b451cbbda4a8%2Flza3i14_processed.jpeg&w=3840&q=75)
Transcribed Image Text:a. Write a program that prompts the user for a file name, then reads that file
(assuming that its contents consist entirely of integers) and prints the maximum,
minimum, sum, count (number of integers in the file), and average of the
numbers. For example, if the file num_input.dat has the following contents:
4 -2 18
15 31
27
Your program would produce the following output:
What is the name of the input file? numberinput.dat
Maximum = 31
Minimum = -2
Sum = 93
Count =
6
Average = 15.5
Expert Solution
![](/static/compass_v2/shared-icons/check-mark.png)
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 3 steps with 1 images
![Blurred answer](/static/compass_v2/solution-images/blurred-answer.jpg)
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
![EBK JAVA PROGRAMMING](https://www.bartleby.com/isbn_cover_images/9781337671385/9781337671385_smallCoverImage.jpg)
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
![C++ for Engineers and Scientists](https://www.bartleby.com/isbn_cover_images/9781133187844/9781133187844_smallCoverImage.gif)
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
![C++ Programming: From Problem Analysis to Program…](https://www.bartleby.com/isbn_cover_images/9781337102087/9781337102087_smallCoverImage.gif)
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning