Answered step by step
Verified Expert Solution
Question
1 Approved Answer
develop a program that maintains a database of information about computer parts stored in a warehouse. The program must utilize an appropriate data structure
develop a program that maintains a database of information about computer parts stored in a warehouse. The program must utilize an appropriate data structure to store information about each part including the part's number, name, and quantity. Your program will support the following operations: Add a new part number, part name, and initial quantity on hand. Given a part number, print the name of the part and the current quantity on hand. The program must print an error message if the part isn't in the database. Given a part number, change the quantity on hand. The program must print an error message if the part isn't in the database or if operation cannot be performed (e.g., changing the quantity would cause a negative quantity). Print a table showing all information in the database. Parts must be displayed in the order in which they were entered. Terminate program execution. You will use the codes i (insert), s (search), u (update), p (print), and q (quit) to represent these operations. See the next page for how a sample session with your program might look. Sample session for program: Enter operation code: i Enter part number: 528 Enter part name: Disk drive Enter quantity on hand: 10 Enter operation code: s Enter part number: 528 Part name: Disk drive Quantity on hand: 10 Enter operation code: s Enter part number: 914 WARNING: PART NOT FOUND. Enter operation code: i Enter part number: 914 Enter part name: Printer cable Enter quantity on hand: 5 Enter operation code: u Enter part number: 528 Enter change in quantity on hand: -2 Enter operation code: s Enter part number: 528 Part name: Disk drive Quantity on hand: 8 Enter operation code: p Part Number Hand 528 914 Part Name Disk drive Printer cable Enter operation code: g GOODBYE...EXITING PROGRAM. 5 Quantity on 8
Step by Step Solution
There are 3 Steps involved in it
Step: 1
include include include struct Part int number stdstring ...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started