Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Your task is to read the data from inventory.txt . If there are no errors when reading the data, the program should prompt the user
Your task is to read the data from inventory.txt If there are no errors when reading the data, the program should prompt the user to provide the desired maximum ratio of unsold items on display call it maxratio This value should be a floatingpoint number between and For each dayitem pair, your program should calculate the ratio of unsold items on display. If this computed ratio is higher than the value in maxratio, your program should retain the available and computed information for this dayitem pair.
To extract the data from inventory.txt your program should have a function named readinventorydata, which takes a single parameter the name of the file containing the data. This function should return a list of dictionaries. Each dictionary should contain the keys dayofweek, itemname, unsoldkg calculated by subtracting the purchased kilograms from the displayed kilograms
Step by Step Solution
There are 3 Steps involved in it
Step: 1
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