Question: language is python example 2 and 3 have to be in one file not two separate files thanks :) Example 2: Write a class named

 language is python example 2 and 3 have to be in

language is python

example 2 and 3 have to be in one file not two separate files

thanks :)

Example 2: Write a class named Retailltem 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 Item #1 Jacket Item #2 Designer Jeans Item #3 Shirt Units in Inventory Price 12 59.95 34.95 20 24.95 40 Example 3: Using Retailltem class from previous exercise, create another class named Cash Register that can be used with the Retailltem class. The Cash Register class should be able to internally keep a list of Retailltem objects. The CashRegister class should have the following methods: purchase_item: That accepts a Retailltem object as an argument. Each time the purchase_item is called, the Retailltem object that is passed as an argument should be added to the list. get_total: Returns the total price of all the Retailltem objects stored in the Cash Register object's internal list. show_items: That displays data about the Retailltem objects stored in the Cash Register object's internal list. clear: That clear Cash Register object's internal list. Demonstrate the Cash Register class in a program that allows the user to select several items for purchase. When the user is ready for check out, the program should display a list of all the items he/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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!