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

  • 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

0 0
Add a comment Improve this question Transcribed image text
Answer #1

JAVA CODE:

import java.util.*;
import java.lang.*;
import java.io.*;

class Chegg
{
   public static void main (String[] args) throws java.lang.Exception
   {
//inititalize customer_arrival to 0 and custom to 0
       int customer_arrival = 1;
       int customer_left = 0;
       System.out.println("Customer "+(1)+" arrived at time: "+0+" mins");
       //declare a loop and at every 4 minutes increment the count of customer_arrival
       // at every seven minutes interval increment the count of customer_left
       for(int i=1;i<=60;i++){
       if(i%4==0){
       System.out.println("Customer "+(i/4 + 1)+" arrived at time: "+i+" mins");
       customer_arrival++;
       }
       if(i%7==0){
       System.out.println("Customer "+(i/7 )+" left at time: "+i+" mins");
       customer_left++;
       }
       }
       // Number of customers in line will be customer_arrival - customer_left -1 because one
       //customer is getting served
       System.out.println("\nNumber of customers in line : "+ (customer_arrival-customer_left-1));
       System.out.println("Current serving customer is :"+ (customer_left+1));
      
   }
}

OUTPUT:

Code screenshot:

Please upvote if this answer helped you. If you have any doubts you can ask them in the comment section.

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? 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...

  • 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...

  • In Java, complete the following: During the lunch hour, the ATM machine in a large office...

    In Java, complete the following: During the lunch hour, the ATM machine in a large office complex is in heavy demand. Customers complain that the waiting time is much too long. The local bank considering the addition of a second ATM machine. But first, the bank needs a few statistics to justify the cost of adding a second ATM machine. Using a Queue, simulate a waiting line at the ATM machine for a period of one hour. Make the following...

  • Burger World is considering opening a drive-through window for customer service. Management estimates that customers will...

    Burger World is considering opening a drive-through window for customer service. Management estimates that customers will arrive at the rate of 15 per hour. The server who will staff the drive-up window can service customers at the rate of one every three minutes. Assuming Poisson arrivals and exponential service, find: 40. Utilization of the teller A) 45% B) 55% C) 65% D) None of the above 41. Average number of customers in the waiting line A) 2.25 B) 5.22 C)...

  • Suppose that the average waiting time at a banking service is 10 minutes. A customer waited...

    Suppose that the average waiting time at a banking service is 10 minutes. A customer waited for 10 minutes, find the probability that he will be still waiting after 30 minutes. What is the approximate probability that the average waiting time of the next 25 customers is at most 12 minutes?

  • 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...

  • A small barbershop, operated by one barber, has room for only one waiting customer. Potential customers...

    A small barbershop, operated by one barber, has room for only one waiting customer. Potential customers arrive at a rate of 6 people per hour, and it takes an average of 15 minutes for the barber to serve a customer. a) Find the steady state probabilities. b) Find the probability that an arriving customer will be turned away. c) Find the expected number of people in the barbershop. d) Find the expected number of people in the barbershop. e) Find...

  • At a convenience store there is only one cashier. It is estimated that average service time...

    At a convenience store there is only one cashier. It is estimated that average service time by the cashier is 2 minutes, and the standard deviation of service time is 1 minute. The owner observed that on average customers arrive every 4 minutes, and the standard deviation of the time between two consecutive arrivals is also 4 minutes. Answer the following questions (or fill in the blanks): a) E(A) = ________, E(S) = _________ (Note: please include the time unit)...

  • Students arrive at the Administrative Services Office at an average of one every 24 minutes, and...

    Students arrive at the Administrative Services Office at an average of one every 24 minutes, and their requests take on average 20 minutes to be processed. The service counter is staffed by only one clerk, Judy Gumshoes, who works eight hours per day. Assume Poisson arrivals and exponential service times. a. What percentage of time is Judy idle? (Round your answer to 1 decimal place.) Percentage of time --------------% b. How much time, on average, does a student spend waiting...

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
ADVERTISEMENT