Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In this assignment, you will write a Java program to do the followings: 1. Read a sequence of values from a le into an array
In this assignment, you will write a Java program to do the followings:
1. Read a sequence of values from a le into an array list.
2. Print out the original list values.
3. Convert the original list values into bar values within the range of [0, 30], and save them in a new array list. To do so, you must nd the maximum value in the list rst, say max. The remaining values should be computed based on the the formula:value30=max, where value is the original value.
4. Print out the bar values.
5. Print out the bar charts with the bar values.
6. Sort the bar values usingCollections.sort().
7. Print out the sorted bar chart.Three sample input files are given to you. A sample output corresponding toinput1.txt is shown in Figure.
Requirements of the program:
1. You should implement methods for this program. If you implement everything withinmain(), you will lose 30 points.
3. Your program should prompt user to enter input le name. While only three input files are given, your program should accept other input file.
4. Your program output should be neat, including labeling and spaces .
5. Your program should have good style (indentation, whitespace, comments, verticalalignment, ...).
Input1.txt
20 30 40 50 25 90 65 input2.txt
200 300 400 500 250 900 650
input3.txt
2000 3000 4000 5000 2500 9000 6500
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