Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_step_2

Step: 3

blur-text-image_step3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

What is the high-low method?

Answered: 1 week ago