Computers and Technology
Computers and Technology, 10.08.2021 02:50, rose5986

Polymorphism with Stores - PYTHON The goal of this program is to create classes that represent to a certain degree different types of stores in real life and the information tracked and services provided by these stores. In order to accomplish this the following required classes have to be created:
I. Create a file called store. py which contains an abstract class called Store which is made up of the following:
Attributes/Properties
o Store name
o Store address
Store availability/status (open or closed)
o Sales tax percentage Functions/Functionality
o Constructor which provides the ability to pass and set the values for the various attributes
Getter and setters for all the attributes mentioned above is_store_open should return True if the store is open and False if the store is closed
Abstract function called: calculate_total_sales_tax
o Abstract function called calculate_total_sales
II. Create a file called restaurant. py which contains a class called Restaurant which is type of Store. It should possess all the attributes and functions present in the Store class without having to re-implement those in the Restaurant class.
The Restaurant class is made up of the following:
Attributes/Properties
o Total number of people served Max occupancy
o Current occupancy o Price per person Functions/Functionality
o Constructor which provides the ability to pass and set the values for the various attributes
seat_patrons should do the following: Take the number of people to be seated as input
Update the values of the appropriate attributes
If number of people to be seated does not exceed or equals the max occupancy
Print "Welcome to [replace with name of restaurant]"
• Return True If number of people to be seated exceeds the max occupancy
Print "We are at capacity, we appreciate your patience"
Return False
serve_patrons which should do the following:
Take the number of people to serve as input
Update the values of the appropriate attributes
Return the number of people being served currently
o checkout_patrons (this is when the patrons are ready to leave the restaurant) which should do the following:
Take the number of people leaving as input
Update the values of the appropriate attributes
Return the current occupancy of the restaurant
o Create a getter and setter for the attribute: Price per person
III. Create a file called grocery_store. py which contains a class called GroceryStore which is type of Store.
It should possess all the attributes and functions present in the Store class without having to re-implement those in the GroceryStore class.
The GroceryStore class is made up of the following:
Attributes/Properties
o Total revenue
Grocery store type (independent or chain)
Functions/Functionality
o Constructor which provides the ability to pass and set the values for the various attributes
sell_item which should do the following:
Takes the quantity and price of an item as input
Update the values of the appropriate attributes
Return the total revenue of the grocery store
o Create a getter and setter for the attribute: Grocery Store type
IV. Create a file called shopping. py which will make use of the above mentioned Restaurant and GroceryStore classes and call their various functions to simulate the actions which take place in real life restaurants and grocery stores in order to test your code.
Reminder: Do not forget to implement the two abstract functions specified in the Store class within each of the classes mentioned above

answer
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 21.06.2019 23:30, sheram2010
Acomputer is a multipurpose device that accepts input, processes data, stores data, and produces output, all according to a series of stored . the processing unit of most modern computers is a(n) . the instructions that tell a computer how to carry out a task are referred to as computer , which are distributed as software. computers run three main types of software: software, system software, and development tools. an example of system software is a computer system, which is essentially the master controller for all the activities that a digital device performs. digital devices are constructed using tiny electronic components that represent data bits as electrical signals. the system unit houses the system board, which contains several circuits made from semiconducting materials. computers come in three popular form factors: component, , and slate. many of today's digital devices operate on battery power supplied by ion batteries. battery life and lifespan can be extended by following good battery management practices.
Answers: 3
image
Computers and Technology, 22.06.2019 02:30, lauriepdx
The cm is responsible for overseeing the actions of the crisis management team and coordinating all crisis management efforts in cooperation with disaster recovery and/or business continuity planning, on an as-needed basis
Answers: 1
image
Computers and Technology, 22.06.2019 10:20, alcantar28eduin
Print "usernum1 is negative." if usernum1 is less than 0. end with newline. convert usernum2 to 0 if usernum2 is greater than 10. otherwise, print "usernum2 is less than or equal to 10.". end with newline
Answers: 3
image
Computers and Technology, 22.06.2019 18:30, lailahussain99
Which of the following is an example of intellectual properly! oa. new version of a novelb. journal of ideasc. pages of a bookood. lines of a poem
Answers: 2
Do you know the correct answer?
Polymorphism with Stores - PYTHON The goal of this program is to create classes that represent to a...

Questions in other subjects:

Konu
Mathematics, 30.05.2021 18:50