Answered step by step
Verified Expert Solution
Link Copied!

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 max_ratio). This value should be a floating-point number between 0 and 1. For each day-item pair, your program should calculate the ratio of unsold items on display. If this computed ratio is higher than the value in max_ratio, your program should retain the available and computed information for this day-item pair.
To extract the data from inventory.txt, your program should have a function named read_inventory_data, 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 day_of_week, item_name, unsold_kg (calculated by subtracting the purchased kilograms from the displayed kilograms),

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

Step: 3

blur-text-image

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

Students also viewed these Databases questions

Question

Evaluate the importance of diversity in the workforce.

Answered: 1 week ago

Question

Identify the legal standards of the recruitment process.

Answered: 1 week ago