Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1 Description of the program In this assignment, you will write a Java program to do the followings: 1. Read a sequence of values from

image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
1 Description of the program In this assignment, you will write a Java program to do the followings: 1. Read a sequence of values from a file 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 find the maximum value in the list first, say max. The remaining values should be computed based on the the formula: value 30/maa, where value is the original value. 4. Print out the bar values. 5. Print out the bar charts with the bar valtves. 6. Sort the bar values using Collections.sort ) 7. Print out the sorted bar chart Undo Cut Copy Paste Find... Close public static ArrayList readValues(String fileName) throws FileNotFound ArrayListInteger list ArrayListIntegers(); = new return list; * Return the largest element in the array list. * Oparam list: the input list * ereturn the largest element in list public static int findMax(ArrayList list) int max-0; return max; *Convert the list valeus into corresponding bar values proportion to the largest * Truncate the fraction part if the resulting bar value is not a whole number * eparam list the input list x/ public static Arraylist convertBarValues (ArrayList list) ayListInteger newlist = new ArrayListIntegers(); return newList; public static void main(String[] args)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Entity Alignment Concepts Recent Advances And Novel Approaches

Authors: Xiang Zhao ,Weixin Zeng ,Jiuyang Tang

1st Edition

9819942527, 978-9819942527

More Books

Students also viewed these Databases questions

Question

Would others consider your presentation respectful?

Answered: 1 week ago