(b) Provide a critique of the code in Appendix 1 in bullet points and explain how...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
(b) Provide a critique of the code in Appendix 1 in bullet points and explain how the code can be better written. (10 marks) Using Python, rewrite the code in Appendix 1 based on the critique and suggestions in 2(a). The rewritten code should achieve a similar outcome and store the updated information entered by the user in a variable. Provide the rewritten code and corresponding output in text format in the report. Screenshots of the codes are not permitted and doing so will attract a 10-mark deduction. (25 marks) Appendix 1 inventory['pen', 'pencil', 'ruler', 'eraser', 'marker'] print(fThis is the list of stationery inventory available [inventory). Please enter any one of them.") continue query-"yes" updated inventory -[1 while continue_query= 'yes': stationery - str(input("What is type of stationery to be updated?")) qty-(input("What is current quantity?")) price (input("What is the current list price? ")) entered_input= [stationery.qty.price] updated_inventory.append(entered_input) continue query str(input("Would you like to continue? (Indicate yes or no)")) (b) Provide a critique of the code in Appendix 1 in bullet points and explain how the code can be better written. (10 marks) Using Python, rewrite the code in Appendix 1 based on the critique and suggestions in 2(a). The rewritten code should achieve a similar outcome and store the updated information entered by the user in a variable. Provide the rewritten code and corresponding output in text format in the report. Screenshots of the codes are not permitted and doing so will attract a 10-mark deduction. (25 marks) Appendix 1 inventory['pen', 'pencil', 'ruler', 'eraser', 'marker'] print(fThis is the list of stationery inventory available [inventory). Please enter any one of them.") continue query-"yes" updated inventory -[1 while continue_query= 'yes': stationery - str(input("What is type of stationery to be updated?")) qty-(input("What is current quantity?")) price (input("What is the current list price? ")) entered_input= [stationery.qty.price] updated_inventory.append(entered_input) continue query str(input("Would you like to continue? (Indicate yes or no)"))
Expert Answer:
Answer rating: 100% (QA)
SOLUTION a Critique of the code in Appendix I Syntax Errors There are multiple syntax errors in the code such as missing colons after statements missing quotation marks around strings and incorrect va... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Pharoah Limited, a public company following IFRS, decided to upgrade the coffee machines in all of its office locations. Pharoah leased 54 machines from Coffee Tyme Ltd. on July 1, 2023. (To purchase...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
A trader has made a sale of Rs.75,500 out of which cash sales amounted to Rs.25,500. He showed trade receivables on 31-3-2014 at Rs.25,500. Which concept is followed by him? a) Going concern b) Cost...
-
Prove that uniform-cost search and breadth-first search with constant step costs are optimal when used with the GRAPH-SEARCH algorithm. Show a state space with constant step costs in which...
-
At the beginning of the year, accounts receivable were $72,000 and the allowance for bad debts was $5,750. During the year, sales (all on account) were $300,000, cash collections were $290,000, bad...
-
(a) Show that Eqs. 8.47 reduce to Eqs. 8.46 when you consider a system of just one object. (b) Follow the procedure used to get from Eq. 8.21 to Eq. 8.24 for a system of many interacting objects....
-
Cheng Company traded a used truck for a new truck. The used truck cost $30,000 and has accumulated depreciation of $27,000. The new truck is worth $37,000. Cheng also made cash payment of $36,000....
-
1 Explain briefly about six sigma and capacity maturity models? 2 Explain about the contemporary management practices taking place in Indian business model? 3 4 What is performance management?...
-
The Tusquittee Company is a retail company that began operations on October 1, 2018, when it incorporated in the state of North Carolina. The Tusquittee Company is authorized to issue 100,000 shares...
-
You are a new hire at Laurel Woods Real Estate, which specializes in selling foreclosed homes via public auction. Your boss has asked you to use the following data (mortgage balance, monthly...
-
List and describe the business models of each airline category.
-
Three of your former classmates from the University of London have started a businesssupplying custom-made construction materials (like pre-fabricated bathroom units) to construction companies and...
-
Why cant an airline offer a passenger everything she or he wants?
-
Your brother wants to borrow $10,750 from you. He has offered to pay you back $12,750 in a year. If the cost of capital of this investment opportunity is 12%, what is its NPV? Should you undertake...
-
Stanley Industries has a fixed conversion ratio of four common shares per one share of preferred stock. The preferred stock pays a dividend of 4.00 per share per year. The common stock currently...
-
One mile measures 5,280 feet long, so one square mile is equivalent to 5,280 square feet. O True O False
-
Read Case Study Google: Dont Be Evil Unless and answer the following: Why do you think Google was adamant about not wanting to supply information requested by the government concerning the Child...
-
In 2012, Gale and Cathy Alexander hosted an exchange student, Axel Muller, for 9 months. Axel was part of International Student Exchange Programs (a qualified organization). Axel attended tenth grade...
-
Phil and Linda are 25-year-old newlyweds and file a joint tax return. Linda is covered by a retirement plan at work, but Phil is not. a. Assuming Phil's wages were $27,000 and Linda's wages were...
-
Professor Patricia (Patty) Pate is retired from the PalmSprings Culinary Arts Academy (PSCAA). She is a single taxpayer and is 68 years old. Patty lives at 98 Colander Street, Henderson, NV 89052....
-
On January 2, 2018, The Register, a science and technology news site based in Britain, published an article revealing the existence of two major bugs leaving virtually all computers and smartphones...
-
In the 1970s, Special Electric Company brokered the sale of crocidolite asbestos, which is the most toxic form of asbestos, to Johns- Manville Corporation. Special Electric never held possession of...
-
Plaintiffs W. O. and J. C. Lucy had wanted to purchase Ferguson Farm from the Zehmers for at least eight years. One night, Lucy stopped by the establishment the Zehmers operated and said that he bet...
Study smarter with the SolutionInn App