Question: I need help.. please post the full code and I will be testing and getting back if there's any problem Write a program that will

I need help.. please post the full code and I will be testing and getting back if there's any problem

Write a program that will insert random integers into a LinkedList and perform some calculations using methods in the LinkedList class.

Create a main class. You will prompt the user to ask them the number of integer objects in your linked list. You will then use a loop to get (for each object) a random number between 1 and 150, create an integer object, and put it in the linked list.

You will then sort the random java integers in your linked list. This will rearrange the integers. You will then use a list iterator to traverse the linked list to print out the index number (make sure you get the index number before you move to the next object), and the random integer number for each of the objects. Use centered column headings for the two columns, and use field widths to line up on the right the two columns of numbers centered under the column headings.

You will then repeat the traversing with the list iterator, but this time sum up the random integers. You will then calculate and print the labeled sum, mean (average to 2 decimal places), range (difference between highest and lowest random integer), and median (middle random integer value) - all without using your input how many variable, but using linked list methods.

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!