Question: For this HW , you will create 3 python files according to the following description. Create a class named Retailitem that holds data about an
For this HW you will create python files according to the following description.
Create a class named Retailitem that holds data about an item in a retail store. The class should store the following private data attributes: item description, units in inventory, and price.
P Please define the data attributes class variables as private attributes and name them as description, inventory, and price.Create a CashRegister class complete the starter file that can be used with the Retailitem class. The CashRegister class has a private data attribute named as items, which is a list object that is used to internally keep a list of Retailitem objects. The class should have the following methods:A A method named purchaseitem that accepts a Retailltem object as an argument. Each time the purchaseitem method is called, the Retailitem object that is passed as an argument should be added to the list.Demonstrate the CashRegister class in a hwpy program complete the starter file that allows the user to select several items for purchase. When the user is ready to check out, the program should display a list of all the items he or she has selected for purchase, as well as the total price.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
