Question: Help!! Objective: The students will learn how to work with queues. 1-Create a new Java Application that has the following methods: 1- A method to

Help!!

Objective: The students will learn how to work with queues.

1-Create a new Java Application that has the following methods:

1- A method to generate a number of element between two given values and save them in a queue

2- A method to print a queue (10 elements per line). The original queue should remain as is after the print

3- A method to search for a value in a queue. The queue should remain the same after the search is finished.

4- A method to exchange the first element and the last element in a queue

5- A method to check if a queue is included in another queue (q1 is included in q2 if q1 is a sub-queue of q2). q1 and q2 should remain as they were originally.

6- A method to inverse a queue.

7- A method to make a copy of a queue into a stack (the original queue should remain as is).

8-The main method that does:

a. Create 2 queues q1 and q2

b. Insert 23 integers between 20 and 60 ( do not insert duplicates) into q1

c. Insert 35 integers between 10 and 80 (do not insert duplicates) into q2.

d. Give the user the choice which methods (2-7) to call and option to exit

2- Write a java program to manage the queues at a bank.

1- Create a class "Person" defined by name, age, account number and transaction. The transaction can be "account" or "enquiry" or "others"

2- Create the Queue class to manage queues.

3- Create the Bank class that has three Queues namely elderQ, accountQ and otherQ.

4- Your program will read the details of Persons coming to the Bank from a file named "today.txt".

5- Your program will assign each person to one of the three queues.

6- People above the age of 50 are assigned to the elderQ, those with account transactions are assigned to the accountQ and others are sent to the otherQ.

7- Your program must display the status of all three Queues.

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!