Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help - Using Retailitem class from the previous exercise, create another class named Cashfegister that can be used with the Retalitem class: - The

please help image text in transcribed
image text in transcribed
image text in transcribed
- Using Retailitem class from the previous exercise, create another class named Cashfegister that can be used with the Retalitem class: - The CashRegister class should be able to internally keep a list of Retalitem objects. - The Cash Register class should have the following methods: purchase_item: That accepts a Retailtem object as an argument. Each time the purchase item is called, the Retailtem object passed as an argument should be added to the list. get total Returns the total price of all the Retailtem objects stored in the CashRegister object's intermal list. - show_items: That displays data about the Retailltem objects stored in the CashRegister object's internal list. clear: That clear 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 for checkout, the program should display a fist of all the items he/she has selected for purchase and the total price. - Write a class named Retailitem that holds data about an item in a retail store. The class should store the following data in attributest - Item description, Units in linventory, and Price. - Once you have written the chass, write a program that creates three Retailitem objects and stores the following data in them: - Design a class named information that holds the following personal data; 6 name, age, address (this attribute has a default value of runknown"), and phone number. - All the attributes are defined as private. - Write appropriate accessor and mutator methods. - Complete the definition of the _ str_ method such that it displays each Information object's data in the following format: " name: "Sarah Jones" - age: "21" - address: "2000 Simcoe North" - Create one instances of the class. - Create a function named display_info that accepts an Information object as an argument and displays the object's name, address, age, and phone number

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_2

Step: 3

blur-text-image_3

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

More Books

Students also viewed these Databases questions

Question

Understand true and false positives and negatives.

Answered: 1 week ago