Make a program in java language with classes that simulates


Program in JAVA language

Consider an health attending service where attending is made in 3 assistance counters, numbered 1 to 3. Users have 4 types of tickets to pick by attending order:

Ticket A - Health Consulting

Ticket B - Exams

Ticket C - PaymentS

Ticket D - Health appointments

Services A and B - take 2 minutes to finish.

Services C and D - take 5 minutes to finish.

Distribution by assistance counters:

1 - Tickets A and B

2 - Ticket C

3 - Ticket D

However, when more than 3 users are in a queue for the same assistance counter, the other assistance counters must attend them by order.

Objective of this work:

Make a program, in JAVA language with classes, that simulates health attending in one business day, according to the information just given.

Program must have an input, from keyboard or file (type of input detected by the system), with a set of rows (lines), with the following format:

hh:mm:ss Xddd

hh - hours

mm - minutes

ss - seconds

X - type of ticket (A, B, C or D)

ddd - number of ticket (001, 002... and so on)

We can also have 2 more commands:

hh:mm:ss queue - show how many tickets are in queue waiting for attend.

hh:mm:ss mean - mean of user's waiting time till be attended.

Example for this lines:

9:15:00 ticket C020

9:15:10 ticket C021

9:15:30 ticket C022

9:15:55 ticket C023

9:16:10 ticket A015

9:16:30 ticket C024

9:17:00 ticket C020 -> assistance counter 1

9:17:00 ticket C021 -> assiscante counter 2

9:17:00 senha C022 -> assistance counter 3

9:22:00 senha A015 -> assistance counter 1

9:22:00 senha C023 -> assistance counter 2

If command 9:23:00 queue was inputed, answer would be:

9:23:00 Tickets waiting: 1 -> C024

If command 9:23:00 mean was inputed, answer would be for:

ticket C020: 120 seconds.

ticket C021: 110 seconds.

ticket C022: 90 seconds.

ticket A015: 350 seconds.

ticket C023: 365 seconds.

So, mean would be (120+110+90+350+365)/5 = 207 seconds = 3 minutes and 27 seconds.

So the answer would be:

9:23:00 Mean waiting time: 3m 27s.

Work must have compressed file with:

_Files *.class (bytecode)

_Files *.java

_Readme txt file with information about how to execute the program.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Make a program in java language with classes that simulates
Reference No:- TGS0668071

Now Priced at $40 (50% Discount)

Recommended (99%)

Rated (4.3/5)