Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with the second part of the python code, to get this result . posting second part of the question. Thank you If a

image text in transcribedimage text in transcribed

Need help with the second part of the python code, to get this result . posting second part of the question. Thank you

If a part is made and/or if there is outstanding product quantity, the details should be recorded in a file, transactions.txt on separate line in this format: o if the product is made, record in this format: make code quantityMade o if there is outstanding product quantity, record in this format: outstanding code quantityOutstanding Example runs Run 1 Enter product code: ABCD Invalid product code ABCD Run 2 Enter product code: ABBB Enter quantity to make: -2 Invalid quantity -2 Run 3 Enter product code: ABBB Enter quantity to make: 2 2 product ABBB Successfully made Run 4 Enter product code: ABBB Enter quantity to make: 2 Insufficient inventory 1 product ABBB made at the current inventory level. 1 outstanding. Content of transaction.txt ... # add to previous contents make ABBB 2 make ABBB 1 outstanding ABBB 1 (10 marks) Get summarised data Prompt and read the type of data (O-restock, 1-make, 2-outstanding) the summary is for. Then, open a file transactions.txt with an appropriate file mode, to produce the summarized report, sorted by quantity followed by either by part or product code. Example runs Assume the following 12 lines are in transactions.txt: make ABBB 2 make ABBC 2 make ABBB 1 outstanding ABBB 1 restock E 60 restock F 10 restock A 60 make ABBC 12 make ABBB 2 make ABBB 2 outstanding ABBB 2 restock F 10 Run 1 -restock, 1-make, 2-outstanding. Enter choice: Summarised Data for RESTOCK *** A 60 E 60 F 20 Run 2 -restock, 1-make, 2-outstanding. Enter choice: 1 Summarised Data for MAKE *** ABBC 14 ABBB 7 Run 3 -restock, 1-make, 2-outstanding. Enter choice: 2 Summarised Data for OUTSTANDING *** ABBB 3

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

Advances In Databases And Information Systems 23rd European Conference Adbis 2019 Bled Slovenia September 8 11 2019 Proceedings Lncs 11695

Authors: Tatjana Welzer ,Johann Eder ,Vili Podgorelec ,Aida Kamisalic Latific

1st Edition

3030287297, 978-3030287290

More Books

Students also viewed these Databases questions