Answered step by step
Verified Expert Solution
Question
1 Approved Answer
You are asked to write a program for a bookstore that will be launching soon. The bookstore has three types of items: textbooks, apparels,
You are asked to write a program for a bookstore that will be launching soon. The bookstore has three types of items: textbooks, apparels, and gift items. Each item has an item name and sales price. Initially, the store can have a maximum of 100 items. The bookstore is offering an opening discount on items as follows: Item Type Discount Textbook 3% Apparel 5% Gift items 10% Create a program that will keep track of the bookstore items. Your program will continuously prompt the user to enter items, one at a time, until the user has indicated that they are finished entering items. For each item, your program must also prompt for the type of the item to determine the discount amount and calculate the sales price. You must validate the item type, name and price providing an error message and re-prompting the user if an invalid input is entered. Keep track the number of items in each category. Once the items are entered, the program should allow the user to search an item by its name. If the item is found, it will show the sales price of the item, otherwise it will display a message that the item is not available at this store. At the end, print a well formatted report listing all the items and their associated price, the total number of items in each type and the average price of all items.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
import pickle def adddata fopenbookdatwb bstore answeryes while answeryes itemtypeinputenter type of ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started