company that delivers packages. It is based in Bandar Baru Bangi. It only has one counter where customers can drop off packages to be delivered around the Klang Valley. The parcel drop-off procedure takes 7 minutes (7 units). Determine the total and average waiting time based on customer arrival times. Implement Alakazam Courier Simulation by combining the given algorithm with a queue data structure. All times are in unit-time; hence there is no need to consider time in hours, minutes and seconds. Input A number of customer arrival times that ends with 0. Output The following details should be displayed for each customer's arrival time: <arrivalTime>#<startServiceTime>#<endServiceTime>#<waitingTime> followed by the total and average waiting time.
Sample Input-Output Input 27 8 24 25 28 0 Output 2#2#9#0 7#9#16#2 8#16#23#8 24#24#31#0 25#31#38#6 28#38#45#10 Total waiting time: 26 unit Average waiting time: 4.33 unit
Proposed Algorithm 1. Define a CustomersArrival class that has four attributes; arrival Time, startServiceTime, endServiceTime and waiting Time. Create a Queue of CustomerArrival. 2. 3. Based on standard input, for non-zero arrival time: Set the arrival Time Calculate the startServiceTime. o For the first customer, startServiceTime = arrival Time. o For the others, • startServiceTime = endServiceTime of previous customer or his arrivalTime, whichever the earliest. Calculate the endServiceTime: o endServiceTime = startServiceTime + task completion period Calculate the waiting Time: o waiting Time = startServiceTime - arrival Time 4. Calculate average waiting Time; all waiting times divide by the number of customers Display all information based on the following format: 5. <arrivalTime>#<startServiceTime>#<endServiceTime>#<waitingTime> 6. Display total and average waiting time
Problem Description One of the significant factors influencing the success of organizations in today's competitive world is increasing customer satisfaction through improving the service quality. In any service organization, managers are most concerned about when customers are required to wait to receive their service. Alakazam Courier is a Problem Description One of the significant factors influencing the success of organizations in today's competitive world
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am