Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Then add the next five ( 5 ) four ( 4 ) objects ( # 9 thru 1 2 ) such that their index in
Then add the next five four objects # thru such that their index in the linked list is calculated as index in array
Remove two objects at indexes countCurrency and countCurrency in that order.
Print the contents of the list.
For the stack, perform the following operations in order
Push seven objects starting from the array index onwards to the stack.
Peek the top of the stack print the result.
Perform three pops in succession.
Print the contents of the stack.
Push five more objects from the start of the objects array to the stack.
Pop twice in succession.
Print the contents of the stack.
For the queue, perform the following operations in order
Enqueue the seven objects at odd indexes starting from index in the array.
Peek the front and end of the queue print the results.
Perform two dequeues in succession.
Print the contents of the queue.
Enqueue five more objects from the index in the array.
Dequeue three times in succession.
Print the contents of the queue.
End the program with a leaving message of your choice. Remember to clean up before the program ends.
Restrict all your input output to the main driver program only, except for the existing screen print inside the Currency print methods.
Your submission will include the following code files only and nothing else:
or class files for this lab's classes LinkNode, SinglyLinkedList, Stack, Queue.
code file for the main of this lab.
Screenshots jpg or png numbered in order of showing the output of the program, in an easy to read zoom factor.
Remember to include prepost documentation and name blocks in your code files.
class files from prior lab's classes Currency, Dollar. If you change anything in your Currency and Dollar class files for this lab, highlight the sections changed with CLEAR comment block explaining why at the top of the code file remember, I have your class files from the prior submission to compare. Not outlining the changes will be cause for deductions.
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