PROBLEM 3 In this problem, we redesign the inventory program for Trish's bookstore using dictionaries. Note:...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
PROBLEM 3 In this problem, we redesign the inventory program for Trish's bookstore using dictionaries. Note: We will be continuing this redesign in Lab 10. Copy the starter code Lab09P3-starter.py to a file named Lab09P3.py. Remember in Lab 08, you used a list of lists to store the item information in the inventory system before writing it out to a file. You will change that now so that you are keeping the information in three dictionaries instead. There are three TODO comments: At the first TODO comment, create three empty directories named inventory_counts, inventory_costs and inventory_descriptions. At the second TODO comment, update the dictionaries with the user entered data. Use the item_name as the key in all dictionaries and store the appropriate data. o For example, if the user first entered the item name "Science Books" with an item count of 10, a unit cost of 12.95, and a description "First year textbook" this is what the dictionaries would look like: inventory_counts Books": 10} inventory_costs {"Science - = {"Science Books" 12.95} inventory_descriptions = {"Science Books": "First year textbook" At the third TODO comment, print the dictionaries. PROBLEM 3 In this problem, we redesign the inventory program for Trish's bookstore using dictionaries. Note: We will be continuing this redesign in Lab 10. Copy the starter code Lab09P3-starter.py to a file named Lab09P3.py. Remember in Lab 08, you used a list of lists to store the item information in the inventory system before writing it out to a file. You will change that now so that you are keeping the information in three dictionaries instead. There are three TODO comments: At the first TODO comment, create three empty directories named inventory_counts, inventory_costs and inventory_descriptions. At the second TODO comment, update the dictionaries with the user entered data. Use the item_name as the key in all dictionaries and store the appropriate data. o For example, if the user first entered the item name "Science Books" with an item count of 10, a unit cost of 12.95, and a description "First year textbook" this is what the dictionaries would look like: inventory_counts Books": 10} inventory_costs {"Science - = {"Science Books" 12.95} inventory_descriptions = {"Science Books": "First year textbook" At the third TODO comment, print the dictionaries.
Expert Answer:
Related Book For
Applied Regression Analysis and Other Multivariable Methods
ISBN: 978-1285051086
5th edition
Authors: David G. Kleinbaum, Lawrence L. Kupper, Azhar Nizam, Eli S. Rosenberg
Posted Date:
Students also viewed these programming questions
-
TASKS The task is to Write academic integrity comment in "pizza_shop.py" (Modify the first comment in the file) Write academic integrity comment in "test_driver.py" (Modify the first comment in the...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
An employee earns $22 per hour and 11/2 times that rate for all hours in excess of 40 hours per week. Assume that the employee worked 50 hours during the week, and that the gross pay prior to the...
-
Use the following balance sheets and income statement to answer QS 12-6 through QS 12-11. Required Use the indirect method to prepare the cash provided or used from operating activities section only...
-
What are the major advantages of international expansion to FIs? Explain how each advantage can affect the operating performance of FIs?
-
Pet-Pro is a company that imports and markets pet food feeders to customers in Malaysia. The food feeder, which is called "Smart Feeder," allows pet owners to feed pre-determined quantities of food...
-
XYZ is a calendar-year corporation that began business on January 1, 2015. For 2015, it reported the following information in its current year audited income statement. Notes with important tax...
-
COMPLETE PART B AND USE NEWTON RAPHSON ITERATION METHOD SO SOLVE WHAT IS a and b. The answer should be 0.79 and 0.19 ish Question 1 Box-shaped design are commonly seen for small satellites. The...
-
A company leases a piece of equipment for five years. The lease agreement specifies annual lease payments of $50,000, an implicit interest rate of 8%, and a fair value of the equipment of $200,000....
-
Find your librarys online databases and check to see if any of them have the ability to automatically put an article you retrieve in a format suitable for citing (e.g., MLA or APA).
-
Wikipedia has a detailed account of hyperinflationary episodes in a number of countries throughout history. Go to the page at...
-
Discuss several reasons why a researcher would choose a within subjects approach over a between-subjects approach.
-
Explain the major premise for using a factorial design.
-
Considering threats to internal validity, is a factorial design considered a "strong" design?
-
Metro Hospital is required to maintain a sinking fund as a condition of bond contracts. Metro Hospital is obligated to transfer $250,000 to the sinking fund on June 1. On June 1, Metro transfers...
-
The process of collaborative goal setting by a manager and subordinate, the extent to which goals are accomplished is a major factor in evaluating and rewarding the subordinate's performance. It is...
-
In Section 13.6, adjusted mean BMI values were obtained for the two nominal variables exercise and tobacco_now. A drawback of the approach used is that these four adjusted means were estimated for...
-
In a study by Yoshida (1961), the oxygen consumption of wireworm larva groups was measured at five temperatures. The rate of oxygen consumption per larva group (in milliliters per hour)the dependent...
-
The following table gives the systolic blood pressure (SBP), body size (QUET), age (AGE), and smoking history (SMK = 0 if a nonsmoker, SMK = 1 if a current or previous smoker) for a hypothetical...
-
W hat is diauxic growth? Explain the roles of cAMP and CAP in this process.
-
What is antisense RNA? How does it affect the translation of a complementary mRNA?
-
What are the functions of activator proteins and repressor proteins in transcription? Explain how these proteins work at the molecular level.
Study smarter with the SolutionInn App