Computers and Technology

For this assignment, you need to develop numberqueue adt (numberqueue. java). we assume each number in the queue represent a person in the line waiting for being served at your restaurant. based on historical data, you found that on average, one customer arrives at your restaurant on every five minutes interval, and it takes 3 minutes to serve each customer. write a tester program, named queuesimulation. java, to simulate the queue for 8 hours, then print the longest queue size during the 8 hours operation. did anyone leave your restaurant because the line if full? (assume the maximum capacity of the line is 10 people)
given: numberqueue. java

public class numberqueue{

private int[] data;
private int front, rear, numberofitems, capacity;
public numberqueue(int cap){
front=rear=numberofitems=0;
data=new int[cap];
capacity=cap;
}
public boolean isempty(){
return numberofitems==0;
}
public boolean isfull(){
return numberofitems==capacity;
}

public int size(){
return numberofitems;
}
public void enqueue(int val){
if(! {
data[rear]=val;
rear= ++rear % capacity;
numberofitems++;
}else{
system. out. println("it is full, find another restaurant! ");
}
}
public int dequeue(){

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 00:30, lilobekker5219
Knowing that the central portion of link bd has a uniform cross sectional area of 800 mm2 , determine the magnitude of the load p for which the normal stress in link bd is 50 mpa. (hint: link bd is a two-force member.) ans: p = 62.7 kn
Answers: 2
image
Computers and Technology, 23.06.2019 12:30, legend101xD
Animations and transitions are added from the
Answers: 1
image
Computers and Technology, 23.06.2019 18:30, sawyerfauver
The computers in the sales department did not have enough data storage capacity to contain all the information the department needed to store, and it was taking a long time for team members to access the data they needed. to fix the problem, the technician installed new, larger hard drives on all the computers.
Answers: 1
image
Computers and Technology, 23.06.2019 19:00, nayo2006
Acompany is hiring professionals for web designing. the firm is small with few resources. they want employees who possess problem-solving skills and can independently carry out responsibilities. which kind of employee should they select?
Answers: 2
Do you know the correct answer?
For this assignment, you need to develop numberqueue adt (numberqueue. java). we assume each number...

Questions in other subjects:

Konu
Mathematics, 09.03.2020 03:31
Konu
History, 09.03.2020 03:31
Konu
Mathematics, 09.03.2020 03:31
Konu
Mathematics, 09.03.2020 03:32