Question: ex1 Create a class called Restaurant that is the base class for all restaurants. It should have attributes for the restaurant's name and numSeats (number
Create a class called Restaurant that is the base class for all restaurants. It should have attributes for the restaurant's name and numSeats (number of seats inside the restaurant). It should have appropriate accessor and mutator methods for each of the attributes and a toString that prints the name and the number of seats. Derive a class FastFoodRestaurant from Restaurant. The new class should override the accessor method for the numSeats, reporting actual seats times 2 (twice the number of seats in a restaurant because it also counts the parking spots where people eat in their cars as restaurant seating). It also should override the toString method so that it includes the correct number of seats and the restaurant ad slogan "Best Burgers Ever!". For example, the toString in the FastFoodRestaurant might return [Welcome to Bob's Burgers with 30 seats. "Best Burgers Ever!"] Write an appropriate demo class that full tests both Restaurant and FastFoodRestaurant
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
