Write a program that asks for the name of an input file. Then, read all the numbers in the file, and display the following information to the screen: count of numbers in the file sum of all numbers in the file average of all numbers in the file (to 2 decimal places) count of numbers in each range (100-199, 200-299, 300-399, etc.) The program should: display a hello message ask the user for an input file display the name of the input file validate the file opens correctly display statistical information as shown above display a goodbye message

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 10PE
icon
Related questions
Question

Write a program that asks for the name of an input file. Then, read all the numbers in the file, and display the following information to the screen:

  • count of numbers in the file
  • sum of all numbers in the file
  • average of all numbers in the file (to 2 decimal places)
  • count of numbers in each range (100-199, 200-299, 300-399, etc.)

The program should:

  • display a hello message
  • ask the user for an input file
  • display the name of the input file
  • validate the file opens correctly
  • display statistical information as shown above
  • display a goodbye message
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
File Input and Output Operations
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.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,