A clothing store maintains inventory on items in their warehouse. All clothing items come in 4...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
A clothing store maintains inventory on items in their warehouse. All clothing items come in 4 standard sizes, S, M, L, XL. There are 2 files that stores the items and inventory. The first file contains the item code and description and the second file contains the inventories of the various sizes. See appendix A for the contents of the 2 files. A program is required to track the movement of inventory in and out of the warehouse. (a) Write a function loadItems (filename) with a string filename as parameter. The function reads in the contents from items.txt, populates a dictionary and returns the dictionary. The key of the dictionary is the item code and the description is the value. Based on the contents of the file given, the dictionary should look like: items={'C10': 'Jogging pants', 'C01': 'Airism T shirt', 'C03': 'Socks', 'C05': 'Polo T', 'C11': 'Shorts'} Ensure all blanks and newline \n characters are stripped. (5 marks) (b) Write a function load Inventory(filename) with a string filename as parameter. The function reads the contents from inventory. txt, populates a dictionary and returns the dictionary. Based on the contents of the file given, the dictionary should look like: {'C85':[18,10,5,4], 'CO1':[9,20,10,5], 'C11':[10,20,18,1], 'C03': [0,0,10,0]} (c) Write a function displayInventory (items, inventory) where the first parameter is the item dictionary, and the second parameter is the inventory dictionary. Display an inventory report, sorted by item code, in the following format: Inventory Report C01 Airism T shirt SO M 20 L 10 XL 5 Total quantity=35 C03 Socks SO Me L 10 XL 0 Total quantity=10 (Only a sample of 2 items shown.) Note: Only partial credit will be given if selection statements are used for this function. (5 marks) (d) Write and develop the main function that has a menu as follows: 1. Add new item ● 2. Update inventory 3. Inventory report 4. Exit Enter option : The main function loads the 2 dictionaries using the functions in part (a) and (b) before the menu is displayed. The description of each of the menu options is as follows: Option 1 Add new item This option allows for adding of new items in the warehouse. Prompt for item code. Ensure that item code is not a duplicate of the existing item codes. This is followed by the description and the 4 sizes. A sample input is as follows: Enter item code: C11 Item code already exists! Enter item code: C88 Enter description: Pullover Enter the quantities (S, M, L, XL): 12, 10, 5,0 Inventory added! Enter item code: <Enter> Note the input requirements: Item code may already exist, display an error message and prompt for the code again. ● This option should allow for many items to be added. Use <Enter> key as indication of end of input. Quantities for the sizes are integers entered with commas in between. No validation of the digits and format is required. Option 2 - Update Inventory Input the item code. If the item exists, the description and existing quantity is displayed, followed by the size and quantity. This quantity is added to the stock level for that particular size. A sample program execution is as follows: Enter item code: C29 Item not found! Enter item code: C11 Item description: Shorts Current inventory (S, M, L, XL): [10, 20, 10, 1] Enter size (S, M, L, XL): XL Enter quantity: 20 C11 size XL quantity updated to 21 If item code is not in the dictionary, display ‘Item not found'. Prompt for item code again. There is no need to validate input for size and quantity. This option allows for only 1 update. It does not prompt for another item code upon successful update. Option 3 - Inventory report Print the complete inventory report as shown in part (c). (10 marks) Appendix A Assume there are no errors in the contents of the 2 files. Items.txt The item code and the description are on separate lines. C10 Jogging pants C01 Airism T shirt C03 Socks C05 Polo T C11 Shorts Inventory.txt The item code and the sizes are separated by : followed by the 4 sizes separated by commas. C05:10,10,5,4 C01:0, 20,10,5 C11:10, 20,10,1 C03:0,0,10,0 ---- END OF ASSIGNMENT ---- A clothing store maintains inventory on items in their warehouse. All clothing items come in 4 standard sizes, S, M, L, XL. There are 2 files that stores the items and inventory. The first file contains the item code and description and the second file contains the inventories of the various sizes. See appendix A for the contents of the 2 files. A program is required to track the movement of inventory in and out of the warehouse. (a) Write a function loadItems (filename) with a string filename as parameter. The function reads in the contents from items.txt, populates a dictionary and returns the dictionary. The key of the dictionary is the item code and the description is the value. Based on the contents of the file given, the dictionary should look like: items={'C10': 'Jogging pants', 'C01': 'Airism T shirt', 'C03': 'Socks', 'C05': 'Polo T', 'C11': 'Shorts'} Ensure all blanks and newline \n characters are stripped. (5 marks) (b) Write a function load Inventory(filename) with a string filename as parameter. The function reads the contents from inventory. txt, populates a dictionary and returns the dictionary. Based on the contents of the file given, the dictionary should look like: {'C85':[18,10,5,4], 'CO1':[9,20,10,5], 'C11':[10,20,18,1], 'C03': [0,0,10,0]} (c) Write a function displayInventory (items, inventory) where the first parameter is the item dictionary, and the second parameter is the inventory dictionary. Display an inventory report, sorted by item code, in the following format: Inventory Report C01 Airism T shirt SO M 20 L 10 XL 5 Total quantity=35 C03 Socks SO Me L 10 XL 0 Total quantity=10 (Only a sample of 2 items shown.) Note: Only partial credit will be given if selection statements are used for this function. (5 marks) (d) Write and develop the main function that has a menu as follows: 1. Add new item ● 2. Update inventory 3. Inventory report 4. Exit Enter option : The main function loads the 2 dictionaries using the functions in part (a) and (b) before the menu is displayed. The description of each of the menu options is as follows: Option 1 Add new item This option allows for adding of new items in the warehouse. Prompt for item code. Ensure that item code is not a duplicate of the existing item codes. This is followed by the description and the 4 sizes. A sample input is as follows: Enter item code: C11 Item code already exists! Enter item code: C88 Enter description: Pullover Enter the quantities (S, M, L, XL): 12, 10, 5,0 Inventory added! Enter item code: <Enter> Note the input requirements: Item code may already exist, display an error message and prompt for the code again. ● This option should allow for many items to be added. Use <Enter> key as indication of end of input. Quantities for the sizes are integers entered with commas in between. No validation of the digits and format is required. Option 2 - Update Inventory Input the item code. If the item exists, the description and existing quantity is displayed, followed by the size and quantity. This quantity is added to the stock level for that particular size. A sample program execution is as follows: Enter item code: C29 Item not found! Enter item code: C11 Item description: Shorts Current inventory (S, M, L, XL): [10, 20, 10, 1] Enter size (S, M, L, XL): XL Enter quantity: 20 C11 size XL quantity updated to 21 If item code is not in the dictionary, display ‘Item not found'. Prompt for item code again. There is no need to validate input for size and quantity. This option allows for only 1 update. It does not prompt for another item code upon successful update. Option 3 - Inventory report Print the complete inventory report as shown in part (c). (10 marks) Appendix A Assume there are no errors in the contents of the 2 files. Items.txt The item code and the description are on separate lines. C10 Jogging pants C01 Airism T shirt C03 Socks C05 Polo T C11 Shorts Inventory.txt The item code and the sizes are separated by : followed by the 4 sizes separated by commas. C05:10,10,5,4 C01:0, 20,10,5 C11:10, 20,10,1 C03:0,0,10,0 ---- END OF ASSIGNMENT ----
Expert Answer:
Answer rating: 100% (QA)
Code Screenshot and Sample Outputs Jupyter CHEGG Last Checkpoint a few seconds ago autosaved Cell Kernel Widgets Help File Edit View Insert In 1 In 4 ... View the full answer
Related Book For
Financial Reporting Financial Statement Analysis and Valuation
ISBN: 978-0324302950
6th edition
Authors: Clyde P. Stickney
Posted Date:
Students also viewed these electrical engineering questions
-
Question 4 25 Marks The Finance Director has set up a company, River, through which Zoom conducts its investment activities. Zoomhas paid R400 million to River during the year and this has been...
-
A clothing store maintains a loyalty program for its customers. For every purchase, members receive points that do not expire. In fiscal 2019, the store made cash sales of $1 million and awarded...
-
A clothing store sells a shirt costing $20 for $33 and a jacket costing $60 for $93. (A) If the markup policy of the store is assumed to be linear, write an equation that expresses retail price R in...
-
Unlike other sciences, the nature and value of philosophy is derived from reflection versus testing, measuring, or examining. O True O False 4
-
The operating activities section of the statement of cash flows for General Motors Corporation is provided below for three recent years. A large expense for General Motors is its pension expense....
-
The Wirehouse Lumber Company will soon begin logging eight groves of trees in the same general area. Therefore, it must develop a system of dirt roads that makes each grove accessible from every...
-
Universal Inc. signed a contract to lease equipment for a 4-year term on January 1,2020 , for \(\$ 20,000\) annually beginning immediately. The lease included a purchase option at the end of the...
-
The following cost data for the year just ended pertain to Heartstrings, Inc., a greeting card manufacturer: Service department costs * ............... $ 50,000 Direct labor: wages .....................
-
DIRECTIONS: Journalize each of the payroll transactions listed below. Omit the writing of the description or explanation for each journal entry, and do not skip a line between each entry. Then post...
-
A Uniform Distributed Load (UDL)= 5 kN/m 4 kN 3 kN 2m 4 m 1.4m 1.2m B
-
This module you will be working on understanding your country's business environment. Based on the given scenario, provide detailed responses to the following prompts below. It is a good idea to...
-
Subtract. 8m+3 m+8 m-7 m-7 8m+3 m+8 m-7 m-7 (Simplify your answer.)
-
Question 2 is based on the following diagram and Arduino sketch. const int ledPin_red = 13; const int ledPin_yellow = 11; const int ledPin_green = 9; const int sensorPin = 0; void setup() { } O }...
-
If petrol prices increase by 10%, what is the amount of the increase when the price is 99.0 cents per litre? What is the new price per litre for petrol?
-
Google Classroom Osvoldo has a goal of getting at least 30% of his grams of carbohydrates each day from whole grains. Today, he ate 220 grams of carbohydrates, and 55 grams were from whole grains....
-
! Required information [The following information applies to the questions displayed below.] Following is information on an investment in a manufacturing machine. The machine has zero salvage value....
-
Cable Corporation is 60% owned by Anna and 40% owned by Jim, who are unrelated. It has noncash assets, which it sells to an unrelated purchaser for $100,000 in cash and $900,000 in installment...
-
While sales and net income have been steady during the last three years, a firm has experienced a decrease in its accounts receivable and inventory turnovers and an increase in its accounts payable...
-
Access the web sites of American Airlines (www.aa.com), Intel (www.intel.com) and Disney (www.disney.com) and study the business involvements of each firm. Examine the financial ratios below and...
-
Sun Trust Banks owns a large block of Coca-Cola Company (Coke) common stock that it has held for many years. SunTrust indicates in a note to its financial statements that all equity securities held...
-
During the year to 30 September 2007, Kammer plc made a new offer of shares. The details of the offer were as follows: 1. 100,000 ordinary shares of 1 each were issued payable in instalments as...
-
Applications were invited by the directors of Grobigg Ltd for 150,000 of its 1 ordinary shares at 1.15 per share payable as follows: Applications were received for 180,000 shares and it was decided...
-
A companys balance sheet appears as follows: Required: (a) If 10,000 of the ordinary shares were purchased at par, there being no new issue of shares for the purpose, show the journal entries to...
Study smarter with the SolutionInn App