CS 121 01 Programming Assignment 04 Chapter 10.TXT

CS 121 01 Programming Assignment 04 Chapter 10

Write a class named RetailItem 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. Be sure to include all necessary methods - __init__, __str__, accessors and mutators. Also, create a method that asks the user for a discount percentage and returns the sales price.
Next, write a program that uses the RetailItem class. Open the file retail.txt located in the I:\kopp\outbox\CS 121 01\Program Assignments\Chapter 10 folder. The data in this file is in the following format: itemDescription,units,priceThe program should create an object of RetailItem for each line of data in the file and store these in a list. The program should then ask the user which item they want to purchase (description) and if the item is on sale. The program should display the object’s data, whether or not the item is on sale, and what the new sale price is.
Powered by