PRG/421 Week 4 Java 4.15 LAB: Ticketing service (Queue)

$ 7

PRG/421 Week 4 Java 4.15 LAB: Ticketing service (Queue)

Given main, complete the program to add people to a queue. The program should read in a list of people’s names including “You” (ending with -1), adding each person to the peopleInQueue queue. Then, remove each person from the queue until “You” is at the head of the queue. Include print statements as shown in the example below.

Ex. If the input is
Zadie Smith
Tom Sawyer
You
Louisa Alcott
-1

the output is
Welcome to the ticketing service…
You are number 3 in the queue.
Zadie Smith has purchased a ticket.
You are now number 2
Tom Sawyer has purchased a ticket.
You are now number 1
You can now purchase your ticket!

991 in stock

SKU: PRG421WK4LAB4P15 Category:

Description

PRG/421 Week 4 Java 4.15 LAB: Ticketing service (Queue)

Given main, complete the program to add people to a queue. The program should read in a list of people’s names including “You” (ending with -1), adding each person to the peopleInQueue queue. Then, remove each person from the queue until “You” is at the head of the queue. Include print statements as shown in the example below.

Ex. If the input is
Zadie Smith
Tom Sawyer
You
Louisa Alcott
-1

the output is
Welcome to the ticketing service…
You are number 3 in the queue.
Zadie Smith has purchased a ticket.
You are now number 2
Tom Sawyer has purchased a ticket.
You are now number 1
You can now purchase your ticket!

Reviews

There are no reviews yet.

Only logged in customers who have purchased this product may leave a review.