Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a Table class using my skeleton code and also create a Junit Test TableTest class. *** Table.java Code *** import java.util.List; public class Table

Create a Table class using my skeleton code and also create a Junit Test TableTest class.

*** Table.java Code ***

import java.util.List; public class Table extends Restaurant { public int size() { return 0; } public List getUtensils() { return null; } public boolean toddlerChair() { return true; } public boolean booth() { return true; } }

**** Restaurant.java Code ****

import java.util.List; public class Restaurant { private List employees; private List foodsServed; private List drinksServed; private int numberofTables; private int waitingCustomers; Restaurant(List employees, List foodsServed, List drinksServed, int numberofTables) { this.employees = employees; this.foodsServed = foodsServed; this.drinksServed = drinksServed; this.numberofTables = numberofTables; this.waitingCustomers = 0; // Initially the waiting customers are 0 when a new restuarant is created } // Method to add an employee to the restuarant's list of employees public void addEmployee(Employee employee) { employees.add(employee); } // Method to get restuarant's list of employees public List getEmployees() { return employees; } // Method to get number of restuarant's employees public int getEmployeesCount() { return employees.size(); } // Method to get food items served in the restaurant public List foodServed() { return foodsServed; } // Method to get price of a food item served in the restaurant public int getFoodItemPrice(String foodItem) { for (int i = 0; i < foodsServed.size(); i++) { if (foodsServed.get(i).getName().equals(foodItem)) { return foodsServed.get(i).getPrice(); } } return 0; } // Method to get drink items served in the restaurant public List drinksServed() { return drinksServed; } // Method to get price of a drink item served in the restaurant public int getDrinkItemPrice(String drinkItem) { for (int i = 0; i < drinksServed.size(); i++) { if (drinksServed.get(i).getName().equals(drinkItem)) { return drinksServed.get(i).getPrice(); } } return 0; } // Method to get kitchen cooking timet public int kitchenCookTime() { return 50; } // Method to get number of tables in the restaurant public int getNumberOfTables() { return numberofTables; } // Method to get number of waiting customers in the restaurant public int getWaitingCustomers() { return waitingCustomers; } } 

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

Step: 3

blur-text-image

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

Database Management System MCQs Multiple Choice Questions And Answers

Authors: Arshad Iqbal

1st Edition

1073328554, 978-1073328550

More Books

Students also viewed these Databases questions

Question

8. Explain the contact hypothesis.

Answered: 1 week ago

Question

2. Define the grand narrative.

Answered: 1 week ago