Question: Implement the following classes in the UML: 1. List class includes: constructor List(): Create an empty list with a length of 100. Hint : double

Implement the following classes in the UML:

1. List class includes:

constructor List(): Create an empty list with a length of 100. Hint: double [] list = new double [100];

constructor List(len: int): Create a List with a user specified maximum length. Hint: double [] list = new double [len];

add: add a new element to the end of the unsorted list.

print: display the list

2.SortedList class includes

two constructors : similar to the constructors in List,

add: add a new element into the ascending sorted list.

3.TestProgram: main method creates a genera list (unsorted) and a sorted list with random numbers using add methods; display the unsorted and sorted lists.

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!