Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with #1 Implement the classes in the following UML: elist: double elength : int List List(len: int + addiele: int): void + print):

Need help with #1 image text in transcribed
Implement the classes in the following UML: elist: double elength : int List List(len: int + addiele: int): void + print): void Stack Queue StackD Stackllen: int) remove(): double +Queuellen: int) eremove): double TestProgram mainargs: String D: void 1. List dlass includes: 1) constructor List 0:Create an empty list with a maximum length of 100 2) constructor List (len: int): Create an empty List with a user specified maximum length 3) add(elerint): add an element to the end of the list Hint: double i it new double [i001 Hint: double 1 list-new double [lenla 4) print: display the list 2. Stack cdass includes: two constructors:similar to the constructors in List 2) 1) remove ): remove an element at the end of the list and return this element 3. Queue class includes 1) two constructors: similar to the constructors in List 2) remove () : remove an element at the beginning of the list and return this element 4.Test Program: main method conduct the following tasks: 1) creates a stack and a queue with 10 random numbers using the add method. 2) display the stack and the queue. 3) Remove two elements from the stack and the queue 4) display the two elements removed from the stack 5) display the two elements removed from the queue 6) display stack and the queue

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

Students also viewed these Databases questions

Question

Is conflict always unhealthy? Why or why not? (Objective 4)

Answered: 1 week ago