Using the following code:
store.py
from abc import ABC,abstractmethod
class Store(ABC): #creating a abstract class
name='' #declaring attributes in class
address=''
status=''
sales_tax_percentage=0.0
def __init__(self,name,address,status,sales_tax_percentage):
#init method to initialize the class attributes
self.name=name
self.address=address
self.status=status
self.sales_tax_percentage=sales_tax_percentage
def get_name(self): #Getter and setter methods for
variables
return self.name
def set_name(self,name):
self.name=name
def get_address(self):
return self.address
def set_address(self,address):
self.address=address
def set_status(self,status):
self.status=status
def get_status(self):
return self.status
def set_sales_tax_percentage(self,sales_tax_percentage):
self.sales_tax_percentage=sales_tax_percentage
def get_sales_tax_percentage(self):
return self.sales_tax_percentage
def is_store_open(self): #check store status or
availability
if self.status=="open": #Return true if store is open
return True
elif self.status=="closed": #Return false if store is closed
return False
def calculate_total_sales_tax(self): #abstract method
pass
def calculate_total_sales(self): #abstract method
pass
This is Restaurant class which extending the store class defined in the question. As the ques states, without implementing the store class... I just extend it to fetch the name of restaurant.
class Restaurant extends store{
int total_people_served, max_occupancy,
current_occupancy;
double price_per_person;
public Restaurant(int total_people_served, int
max_occupancy, int current_occupancy, double
price_per_person){
this.total_people_served=
total_people_served;
this.max_occupancy=
max_occupancy;
this.current_occupancy=
current_occupancy;
this.price_per_person=
price_per_person;
}
public int seat_patrons(int numOfPeopleSeated){
int check=
this.current_occupancy+numOfPeopleSeated;
if(check <=
this.max_occupancy){
serve_patrons(numOfPeopleSeated);
this.total_people_served+=numOfPeopleSeated;
this.current_occupancy+=numOfPeopleSeated;
return 1 ;
}
else
return 0;
}
public void serve_patrons(int num){
System.out.println("number of
people being served: "+ num);
}
public void checkOut(int
checkout_total){
this.current_occupancy-=checkout_total;
System.out.println("current
occupancy: "+ this.current_occupancy);
}
public static void main(String[] args){
int ch, ch_in;
Scanner sc= new
Scanner(System.in);
store s1= new store();
s1.setName("KFC");
Restaurant r1= new Restaurant(100,
15, 10, 500);
System.out.println("Enter number of
people arrive: ");
ch_in= sc.nextInt();
int res=
r1.seat_patrons(ch_in);
if(res == 1){
System.out.println("Welcome to "+ s1.getName());
}else
System.out.println("We are at capacity, we appreciate your
patience");
System.out.println("Enter number of
people for checkout: ");
ch= sc.nextInt();
r1.checkOut(ch);
}
}
The Store class:
public store(){
}
public store(String name,String address, int status, double
sales_tax_percentage){
this.name= name;
this.address=address;
this.status=status;
this.sales_tax_percentage= sales_tax_percentage;
}
public String getName(){
return this.name;
}
public void setName(String name){
this.name= name;
}
public String getAddress(){
return this.address;
}
public void setAddress(String address){
this.address= address;
}
public int getStatus(){
return this.status;
}
public void setStatus(int status){
this.status= status;
}
public double getsales_tax_percentage(){
return this.sales_tax_percentage;
}
public void settsales_tax_percentage(double
sales_tax_percentage){
this.sales_tax_percentage= sales_tax_percentage;
}
}
Now run the program and outputs are follows:

in here max capacity= 15, So when I gave input 4 as number of people arrived
current occupancy was 10, 10+4 = 14,
14< 15, that's why it prints welcome message.
Then check out people input is given as 3, so,
current occupancy= 14,, 14- 3= 11,
and it shows current occupancy as 11 in output.
On 2nd time running of code:
I gave input as 7,
So, current occupancy= 10, i.e. 10+7= 17,
Max occupancy = 15, Which is smaller then current arrival of people
Thus shows "the patience" message.
Images showing the code implementation on Notepad++


Using the following code: store.py from abc import ABC,abstractmethod class Store(ABC): #creating a abstract class name=''...
Here is a sample run of the tester program: Make sure your program follows the Java Coding Guidelines. Consider the following class: /** * A store superclass with a Name and Sales Tax Rate */ public class Store { public final double SALES_TAX_RATE = 0.06; private String name; /** * Constructor to create a new store * @param newName */ public Store(String newName) { name = newName; } ...
PYTHON 3.6 Overview In this assignment we implement a class called TripleString. It consists of a few instance attribute and a few instance methods to support those attributes. In the next assignment, the TripleString class will help us create a more involved application. Before we do that though, we have to thoroughly test our TripleString implementation. Specifications The class TripleString will contain symbolic constants, instance attributes, and instance methods. ▶ Class symbolic constants This class has 3 symbolic constants, which...
In Java, Write a class encapsulating a restaurant,which inherits from Store. A restaurant has the following additional attributes: how many people are served every year and the average price per person. code the constructor, accessors, mutators, toString and equals method of the new subclass; also code a method returning the average taxes per year. You also need to include a client class to test your code for both the parent class and the subclass. Code for Store below(Super class aka...
USING JAVA,
Class Design: Person The Person class is intended to be an abstract and simplified representation of a person. Each person will have an array of "friends" - which are other "Person" instances. Data to Store (2 Points) Name private instance variable with only private setter (2 Points) Friends private instance array with neither getter nor setter Actions Constructor o 1 Point) Take in as argument the name of the person (enforce invariants) o (1 Point) Initialize the array...
Use your Food class, utilities code, and sample data from Lab 1 to complete the following Tasks. def average_calories(foods): """ ------------------------------------------------------- Determines the average calories in a list of foods. foods is unchanged. Use: avg = average_calories(foods) ------------------------------------------------------- Parameters: foods - a list of Food objects (list of Food) Returns: avg - average calories in all Food objects of foods (int) ------------------------------------------------------- """ your code here is the...
***IN PYTHON 2.7****Augment the following code with a new class named 'Coin'. Coin should inherit from Die, with the following modifications; The constructor should not take any arguments; a coin always has two sides add a flip() method that uses the roll() method from the parent class. If roll returns 1; flip should return "HEADS". If roll returns a 2, flip should return "TAILS" Do not override the roll or rollMultiple methods from the parent class #!/usr/bin/python # your class...
class Livestock: def __init__(self,name,price_in,utilizations): self.name,self.price_in,self.utilizations = name,float(price_in),utilizations def __lt__(self,other): if self.utilizations is None: return True elif other.utilizations is None: return False else: return self.utilizations.count(';') < other.utilizations.count(';') def __eq__(self,other): return self.name == other.name def __repr__(self): return ("{}, {}".format(self.name,self.price_in)) raw_livestock_data = [ # name, price_in, utilizations ['Dog', '200.0', 'Draught,Hunting,Herding,Searching,Guarding.'], ['Goat', '1000.0', 'Dairy,Meat,Wool,Leather.'], ['Python', '10000.3', ''], ['Cattle', '2000.75', 'Meat,Dairy,Leather,Draught.'], ['Donkey', '3400.01', 'Draught,Meat,Dairy.'], ['Pig', '900.5', 'Meat,Leather.'], ['Llama', '5000.66', 'Draught,Meat,Wool.'], ['Deer', '920.32', 'Meat,Leather.'], ['Sheep', '1300.12', 'Wool,Dairy,Leather,Meat.'], ['Rabbit', '100.0', 'Meat,Fur.'], ['Camel', '1800.9', 'Meat,Dairy,Mount.'], ['Reindeer', '4000.55', 'Meat,Leather,Dairy,Draught.'],...
Python only please, thanks in advance.
Type up the GeometricObject class (code given on the back of the paper). Name this file GeometricObjectClass and store it in the folder you made (xxlab14) 1. Design a class named Rectangle as a subclass of the GeometricObject class. Name the file RectangleClass and place it in the folder. 2. The Rectangle class contains Two float data fields named length and width A constructor that creates a rectangle with the specified fields with default...
Task 2: SecretWord class:
Download and save a copy of LinkedLists.py (found at the bottom
of this assignment page on eClass). In this file, you have been
given the complete code for a LinkedList class. Familiarize
yourself with this class, noticing that it uses the Node class from
Task 1 and is almost identical to the SLinkedList class given in
the lectures. However, it also has a complete insert(pos, item)
method (which should be similar to the insert method you...
JAVA The following is about creating a class Ruler and testing it. (i) Create a class Ruler with the attributes brand (which is a string) and length (an integer) which are used to store the brand and length of the ruler respectively. Write a constructor Ruler(String brand, int length) which assigns the brand and length appropriately. Write also the getter/setter methods of the two attributes. Save the content under an appropriate file name. Copy the content of the file as...