Question
in Python, Class TEMPLATE FOR RetailItem class : #Create the Employee class class Employee: #The __init__ method initializes the attributes def __init__(self, name, id_number, department,
in Python, Class TEMPLATE FOR RetailItem class :
#Create the Employee class
class Employee: #The __init__ method initializes the attributes def __init__(self, name, id_number, department, title): self.__name = name self.__id_number = id_number self.__department = department self.__title = title
#The set_name method sets the employee name def set_name(self,name): self.__name = name
#The set_id_number method sets the employee ID def set_id_number(self, id_number): self.__id_number = id_number
#The set_department method sets the employee department def set_department(self, department): self.__department = department
#The set_title method sets the employee job title def set_title(self, title): self.__title = title
#create get methods #The get_name method returns the employee name def get_name(self): return self.__name #return id_number type method def get_id_number(self): return self.__id_number #return department method def get_department(self): return self.__department
#return title method def get_title(self): return self.__title
# The __str__ method returns the object's state # as a string. def __str__(self): return "Name: " + self.__name + \ " ID: " + self.__id_number + \ " Dept.: " + self.__department + \ " Title: " + self.__title
5. Retailltem Class Write a class named Retaillitem that holds data about an item in a retail store. The class should store the following data in attributes: item description, units in inventory, and price. Once you have written the class, write a program that creates three Retailltem objects and stores the following data in them: Description Units in Inventory Price Item #1 Jacket 12 59.95 Item #2 Designer Jeans 40 34.95 Item #3 Shirt 20 24.95 8. Cash Register This exercise assumes you have created the Retaillter class for Programming Exercise 5. Create a CashRegister class that can be used with the Retailltem class. The Cash Register class should be able to internally keep a list of Retailltem objects. The class should have the following methods: A method named purchase_item that accepts a Retailltem object as an argument. Each time the purchase_item method is called, the Retailltem object that is passed as an argument should be added to the list. A method named get_total that returns the total price of all the Retailiter objects stored in the CashRegister object's internal list. A method named show_items that displays data about the Retailltem objects stored in the CashRegister object's internal list. A method named clear that should clear the CashRegister object's internal listStep 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