Answered step by step
Verified Expert Solution
Question
1 Approved Answer
using Python, 9 . 1 Wk 4 Milestone 2 ( Part 1 - User objects ) Instructor note: STOP! This chapter [ Wk 4 (
using Python, Wk Milestone Part User objects
Instructor note:
STOP!
This chapter Wk Python Project Programming Milestone User objects starting with section Wk Milestone Part User objects is for students completing the Python path of this capstone project.
If you are following the Java path for the capstone project, please navigate back to Blackboard and find the link to Wk Java Project Programming Milestone User objects You can also navigate within the zyBook to Chapter section to complete your graded work for week
Vendor truck ordering application is a capstone project that allows a food truck company to maintain a food and user database as well as enable customers to place orders.
This project is divided into milestones: Database setup, User object implementations with database access, and Final system integration.
Milestone consists of labs. In this lab, three user classes are defined: a User base class, an Admin class that extends User, and a Customer class that extends User.
Follow the specifications listed below to complete Users.py
User is the base class for Admin and Customer classes with the following specifications:
Attributes
username string type username of user
account string type account type of user admin or customer
firstname string type first name of user
lastname string type last name of user
email string type email address of user
phonenum string type phone number of user
password string type password of user
Instance method
initusername, account, firstname, lastname, email, phonenum, password
An overloaded constructor that instantiates a User object with the parameters.
Admin is a class that extends User class. Admin objects are used to describe users with admin account type and has the following specifications:
Attributes
employId string type employee ID of admin user
Instance methods
initusername, account, firstname, lastname, email, phonenum, password, id
An overloaded constructor that instantiates a Admin object with the parameters.
str
Return a string representation of Admin object.
Ex: for an Admin object with username, firstname, lastname, and employId the str method returns
firstname lastname: username, Employee ID: employId
Customer is a class that extends User class. Customer objects are used to describe users with customer account type and has the following specifications:
Attributes
cardnum string type credit card number of the customer
carddate string type expiration date of credit card
address string type billing address of the customer
points int type reward points the customer has accumulated
history int type receipt number of the customer's last order
Instance methods
initusername, account, firstname, lastname email, phonenum, password, cardnum, carddate, address, points, history
An overloaded constructor that instantiates a Customer object with the parameters.
Set username to "Guest" and other attributes to or as default values if no parameter is entered.
str
Return a string representation of Admin object.
Ex: for a Customer object with username, firstname, lastname, and points, the str method returns
firstname lastname: username, Rewards: points
This lab does not use DbManager.py; therefore do not use the FoodVendar.py from Milestone Modify the main method in FoodVendor.py provided in this lab to test the new user classes. See examples in the template file.
qxzqy
LAB ACTIVITY
: Wk Milestone Part User objects
Downloadable files
FoodVendor.py
and
from Users import User, Admin, Customer
if namemain:
# Part of Milestone
# Test cases
person Usergwarner "customer", "Gwion", "Warner", "gwarner@mail.com", zJk@rAvua
printAccount type: formatpersonaccount
printFirst name last name: formatpersonfirstname, personlastname
printEmail address: formatpersonemail
printPhone number: formatpersonphonenum
printPassword: formatpersonpassword
person Customer
printusername: formatpersonusername
printFirst name last name: formatpersonfirstname, personlastname, personhistoryUserspy
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