Question: Create a program in Java with the following requirements: Using a Scanner, read the data from the input3.txt file into an array Calculate the average

Create a program in Java with the following requirements:

  • Using a Scanner, read the data from the input3.txt file into an array
  • Calculate the average of these 50 numbers
  • Output the numbers 5 to a line. If the number being output is larger than the average output a > character next to it
  • Calculate how many times each number appears in the input file (how many 0s, how many 1s, )
  • Output the number of times each value appears as a simple graph. Output the number and the a * for each time it appeared in the input file on the same line. For example, if zero appeared in the file 7 times, the line for zero would look like:
    • 0 = *******

The text file "input3.txt" contains the following 50 random integers in the range from 0 to 9:

5

8

8

1

5

0

6

6

5

3

4

0

6

8

5

4

9

5

8

0

4

7

4

2

0

9

8

3

5

5

5

7

5

7

1

4

4

0

7

4

8

4

2

4

9

8

8

2

3

4

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!