Answered step by step
Verified Expert Solution
Question
1 Approved Answer
finish up the code below so it runs as so: Customers in a Queue Simulation! How many service areas? 4 How long, in minutes, should
finish up the code below so it runs as so: Customers in a Queue Simulation!
How many service areas?
How long, in minutes, should the simulation run?
Total customers served
Average wait time
Longest wait time
Longest queue this is the code so far: import java.util.;
import java.io;
public class CustomersInQueue
public static final double CHANCEOFCUSTOMER ;
public static void outfileServiceAreasAndQueuePrintWriter outfile, int min, Customer atServiceWindow, Queue queue
outfile.printmin : ;
forCustomer c : atServiceWindow
if c null
outfile.printctoString;
outfile.println queue;
public static double calculateAverageint totalMinutes, int customers
return int totalMinutescustomers ;
public static PrintWriter setUpFile
PrintWriter outfile null;
try
outfile new PrintWriternew FileWritercustomersSimulationtxt;
catchIOException e
System.out.printlnFile not created";
System.exit;
return outfile;
public static void mainString args
PrintWriter outfile setUpFile;
System.out.printlnCustomers in a Queue Simulation! ;
Scanner kb new ScannerSystemin;
System.out.printHow many service areas? ;
int sa kbnextInt;
System.out.printHow long, in minutes, should the simulation run? ;
int time kbnextInt;
serveTheCustomerstime sa outfile; run the simulation
public static void serveTheCustomersint time, int numberofserviceAreas, PrintWriter outfile
call outfileTimeAndQueue to store the queue to the file.
static class Customer
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started