Question

Suppose there is only one customer service available in SAMBA Bank in Thursday morning, in every...

Suppose there is only one customer service available in SAMBA Bank in Thursday morning, in every 4 minutes a new customer arrives at the end of waiting line, each customer will need 7 minutes for the service

Write a program to print out the information after the first 60 minutes

o The time of arriving for each customer
o The time of leaving for each customer
o How many customers are in the line?
o Who is the current serving customer?


Programming language: netbeans
Hint : use queue concept
0 0
Add a comment Improve this question Transcribed image text
Answer #1
  • I have pasted the code and screenshot of sample run below.
  • In case of any doubts just comment down.

----------------------Screenshot--------------------------

------------------CustomerService.java---------------------

import java.util.LinkedList;

import java.util.Queue;

class Customer{

public static int count = 0;

public int enterTime, leaveTime;

public int id;

}

public class CustomerService{

public static void main(String[] args) {

Queue<Customer> q = new LinkedList<>();

Customer curr = null;

int endTime = 60;

for(int i=0;i<=endTime;i++){

if(i%4==0){

Customer c = new Customer();

c.id = Customer.count;

Customer.count++;

c.enterTime = i;

q.add(c);

System.out.println("t=" + i + " " + "Customer #" + c.id + " entered queue");

}

if(i%7==0){

if(curr!=null){

System.out.println("t=" + i + " " + "Customer #" + curr.id + " left");

}

curr = q.remove();

System.out.println("t=" + i + " " + "Customer #" + curr.id + " is being served");

}

}

}

Add a comment
Know the answer?
Add Answer to:
Suppose there is only one customer service available in SAMBA Bank in Thursday morning, in every...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Suppose there is only one customer service available in SAMBA Bank in Thursday morning, in every...

    Suppose there is only one customer service available in SAMBA Bank in Thursday morning, in every 4 minutes a new customer arrives at the end of waiting line, each customer will need 7 minutes for the service. Write a program to print out the information after the first 60 minutes The time of arriving for each customer The time of leaving for each customer How many customers are in the line? Who is the current serving customer? please by Java...

  • Suppose there is only one customer service available in SAMBA Bank in Thursday morning, in every...

    Suppose there is only one customer service available in SAMBA Bank in Thursday morning, in every 4 minutes a new customer arrives at the end of waiting line, each customer will need 7 minutes for the service Write a program to print out the information after the first 60 minutes The time of arriving for each customer The time of leaving for each customer How many customers are in the line? Who is the current serving customer? In java

  • Suppose there is only one customer service available in SAMBA Bank in Thursday morning, in every...

    Suppose there is only one customer service available in SAMBA Bank in Thursday morning, in every 4 minutes a new customer arrives at the end of waiting line, each customer will need 7 minutes for the service Write a program to print out the information after the first 60 minutes The time of arriving for each customer The time of leaving for each customer How many customers are in the line? Who is the current serving customer? in java

  • Trader Joe’s has one register open with the customer service employee able to process one customer...

    Trader Joe’s has one register open with the customer service employee able to process one customer every 4.8 minutes. There are approximately 2 customers checking out per hour (i.e., arrival rate during off-peak hour).   What is the utilization of the customer service employee ? What is the average number of customers in the waiting line? What is the average customer waiting time in line (in minutes)? What is the probability that there will be more than one customer waiting in...

  • 1) A fast-food franchise is considering opening a drive-up window food service operation. Assume that customer...

    1) A fast-food franchise is considering opening a drive-up window food service operation. Assume that customer arrivals follow a Poisson distribution ( interarrival times follow an exponential distribution), with a mean arrival rate of 24 cars per hour, and that service times follow an exponential probability distribution. Arriving customers place orders at an intercom station at the back of the parking lot and then drive up to the service window to pay for and receive their order. The following four...

  • JAVA CODE REQUIRED A barber shop has one or more barbers who service customers as they...

    JAVA CODE REQUIRED A barber shop has one or more barbers who service customers as they arrive on a first- come-first-serve basis. Depending on the type of haircut a customer desires the service time varies. A barber shop also has a limited number of chairs for waiting customers. If all the chairs are filled, an arriving customer leaves without entering. For this assignment you will simulate a barber shop with customers arriving at various times each requiring a variety of...

  • For the following problems compute (a) utilization, (b) average time a customer waits in the queue,...

    For the following problems compute (a) utilization, (b) average time a customer waits in the queue, (c) average number of customers waiting in the queue, (d) average number of customers in service, (e) the average time a customer spends in the system. Problem 1. An average of 10 cars per hour (with variance 4) arrives at a single-server drive-in teller. Assume that the average service time for each customer is 5.5 minutes (with variance 5). Problem 2. Customers arrive to...

  • 7. The Canara Bank drive-thru teller window can serve a customer at an average of 4...

    7. The Canara Bank drive-thru teller window can serve a customer at an average of 4 minutes per customer. Service time has a negative exponential distribution. Customers arrive in their cars at a rate (Poisson distributed) of 12 per hour and form a single waiting line: a. Determine the average waiting time, the average queue length, and the probability that there is no customer in the system. b. If Canara Bank decides to open a second drive-thru teller window with...

  • A system has a common checkout line for customers to wait to be served by one of four servers. Every customer arrives ba...

    A system has a common checkout line for customers to wait to be served by one of four servers. Every customer arrives based on an exponential distribution with mean .5 minutes and it takes Tria(1, 2, 3) minutes for checkout processing. Ignoring the time to walk from the queue to the server, what is the steady state utilization? Is the system stable?

  • 4. When John enters the bank office, there are four customers waiting in line and one...

    4. When John enters the bank office, there are four customers waiting in line and one customer is being served. There is a single clerk and the service time is exponentially distributed with λ-10 customer per hour, independent of everything else. (a) (2 points) What is the average service time per customer? (b) (4 points) What is the distribution of John's waiting time? (c) (4 points) Calculate the expected value and variance of John's waiting time. (d) (10 points) It...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT