Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need a little help on this last bit of my computer science homework. Here is the problem. This by the way is the restaurant

I need a little help on this last bit of my computer science homework. Here is the problem.

image text in transcribed

This by the way is the restaurant class in case you need it.

package lab1;

import java.util.List;

public class Restaurant extends Customer { int maxSeat = 0; public static Customer[] currList; { int currList = 0; } public static Customer[] waitList; { int waitList = 0; } public Restaurant (int maxSeat, int currList[], int waitlist[]) { super(getPhone(), getName()); this.maxSeat = maxSeat; this.currList = new Customer[maxSeat]; this.waitList = new Customer[10]; } public void display(Customer[] customerList, int n) { int numElements = Math.min(customerList.length, n); for (int i = 0; i currList, Customer newCustomer, List waitlist) { int maxSeat = 10;

if (currList.size()

System.out.println("New Customer has been added to the end of the List."); } else if (waitlist.size()

System.out.println("New Customer has been added to the wait list."); } } public static void remove(List currList, Customer targetCustomer, List waitlist) { if (waitlist.contains(targetCustomer)) { waitlist.remove(targetCustomer); } else if (currList.contains(targetCustomer)) { currList.remove(targetCustomer);

if (!waitlist.isEmpty()) { Customer nextCustomer = waitlist.get(0);

waitlist.remove(0);

currList.add(nextCustomer); } } } }

How do I do this? Java please and let me know if you need more information.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

=+8 How can a company make a direct foreign investment?

Answered: 1 week ago

Question

Define indirect financial compensation (employee benefits).

Answered: 1 week ago