SOLVED:CS 121 01 Programming Assignment 04 Chapter 10

15.00 $

Click Category Button to View Your Next Assignment | Homework

You'll get a download link with a: . txt solution files instantly, after Payment


5/5 - (1 vote)

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.

  • CS_121_01.txt