Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create a Party class using my skeleton code and also create a Junit Test PartyTest class. Let me know if anymore info is needed. Thanks.
Create a Party class using my skeleton code and also create a Junit Test PartyTest class. Let me know if anymore info is needed. Thanks.
*** Party.java Code ***
import java.util.List; public class Party extends Restaurant { public int partySize() { int partySize = 0; return partySize; } public boolean hasKids() { boolean kids = true; return kids; } public int waitTime() { int waitTime = 0; return waitTime; } public double payment () { double paymentAmount = 0.0; return paymentAmount; } public int age() { int age = 0; return age; } }
**** Restaurant.java Code ****
import java.util.List; public class Restaurant { private Listemployees; 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
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