subject

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

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 00:00, lilyforeman5867
Match each vocabulary word to its definition.1. desktoppicture used to represent acomputer application2. domainnetwork protectionsoftware code that can be viewed,3. iconmodified, and redistributed for freethe background screen on acomputer monitor4. url5. blogan online journalthe part of an internet address that6. firewallrefers to a group of computers on anetworkonline database of web pages7. intranetnetwork for use by an individual8. open address of a web page or9. wikiresource
Answers: 2
image
Computers and Technology, 22.06.2019 04:30, zetrenne73
How can you know if the person or organization providing the information has the credentials and knowledge to speak on this topic? one clue is the type of web site it is--the domain name ".org" tells you that this site is run by a nonprofit organization.
Answers: 2
image
Computers and Technology, 22.06.2019 08:40, batman48000
1. the program must provide following functions to extract some statistics. note that the data_list parameter specified in these functions may be the same for all functions or different for different functions—that is your choice. a skeleton file is provided on mirmir. a) open_file()prompts the user to enter a year number for the data file. the program will check whether the year is between 1990 and 2015 (both inclusive). if year number is valid, the program will try to open data file with file name ‘year. txt’, where is the year. appropriate error message should be shown if the data file cannot be opened or if the year number is invalid. this function will loop until it receives proper input and successfully opens the file. it returns a file pointer and year. i. hint: use string concatenation to construct the file name b) read_file(fp)has one parameter, a file pointer read. this function returns a list of your choosing containing data you need for other parts of this project. c) find_average(data_list) takes a list of data (of some organization of your choosing) and returns the average salary. the function does not print anything. hints: i. this is not the average of the last column of data. it is not mathematically valid to find an average by finding the average of averages—for example, in this case there are many more in the lowest category than in the highest category. ii. how many wage earners are considered in finding the average (denominator)
Answers: 1
image
Computers and Technology, 22.06.2019 14:40, davidb1113
You begin your first day of responsibilities by examining the recent is security breach at gearup to get ideas for safeguards you will take. at gearup, criminals accessed the company's improperly-secured wireless system and stole customers' credit card information as well as employee social security numbers. what kind of computer crime did gearup face?
Answers: 3
You know the right answer?
Polymorphism with Stores - PYTHON The goal of this program is to create classes that represent to a...

Questions in other subjects:

Konu
Mathematics, 04.02.2020 12:52
Konu
Mathematics, 04.02.2020 12:52
Konu
Mathematics, 04.02.2020 12:52