Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

7. Cash Register This exercise assumes that you have created the Retailitem class for Programming Exercise 5. Create a CashRegister class that can be used

image text in transcribed
7. Cash Register This exercise assumes that you have created the Retailitem class for Programming Exercise 5. Create a CashRegister class that can be used with the RetailItem class. The cashRegister class should be able to internally keep a list of RetailItem objects. The class should have the following methods: . A method named purchase item that accepts a Retailitem object as an argument. Each time the purchase item method is called, the RetailItem 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 RetailItem objects stored in the CashRegister object's internal list. . A method named show items that displays data about the RetailItem objects stored in the cashRegister object's internal list. . A method named clear that should clear the CashRegister object's internal list. Demonstrate the CashRegister class in a program 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. RetailItem Clas Write a class named Retailrtem 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 RetailItem objects and stores the following data in them: Item #1 Item #2 Item #3 Description Jacket Designer Jeans Shirt Units in Inventory 12 40 20 Price 59.95 34.95 24.95 write it in python program and as .py file

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: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Formal SQL Tuning For Oracle Databases Practical Efficiency Efficient Practice

Authors: Leonid Nossov ,Hanno Ernst ,Victor Chupis

1st Edition

3662570564, 978-3662570562

More Books

Students also viewed these Databases questions

Question

LO1 Discuss four different views of motivation at work.

Answered: 1 week ago

Question

LO6 Summarize various ways to manage retention.

Answered: 1 week ago