develop a program that maintains a database of information about computer parts stored in a warehouse....
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
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 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
Expert Answer:
Answer rating: 100% (QA)
include include include struct Part int number stdstring ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Plutonium-239 has a half-life of approx. 24, 120 years. Assuming we started with 30 grams, how many grams of plutonium would there still be after 39,056 years?
-
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...
-
You are required to write a Python program that will manage character (heroes and villain) information. Character (hero and villain) information will be stored in a text file that will be read in...
-
Suppose the management of the First National Bank of New York decides that it needs to expand its fee-income-generating services. Among the services the bank is considering adding to its service menu...
-
At one position during its cycle, the foot pushes straight down with a 440-N force on a bicycle pedal arm that is rotated an angle = 65 from the vertical, as shown in FIGURE 11-39. If the force is...
-
Dennis Harding is considering acquiring a new automobile that he will use 100% for business. The purchase price of the automobile would be $48,500. If Dennis leased the car for five years, the lease...
-
Symbol A could represent (a) computation of gross pay. (b) input of payroll data. (c) preparation of paychecks. (d) verification of pay rates.
-
Malco Enterprises issued $10,000 of common stock when the company was started. In addition, Malco borrowed $36,000 from a local bank on July 1, 2016. The note had a 6 percent annual interest rate and...
-
possible This question: 1 point(s) possible Sea Cruise Equipment Company has several divisions that are investment centers. Data for the Boat Division and the Trailer Division are shown here:...
-
Provide a brief evaluation of the different types of machine learning methods that can be used to improve the recommendation system, and ultimately, the output generated by the algorithm. In your...
-
On Monday morning, you arrive at work and discover you have an email from your manager, Sara, about a customer service issue. She is worried because one of the companys most important clients did not...
-
Jack, a 67-year-old White man, and Tim, a 68-year old Black man, have been friends for over 60 years. They attended school together for many years in Detroit until Jack transferred to a different...
-
The case and our analysis focus on the Galvanized Pallet Nails (GPN) product line. Insteel management conducted an activity-based costing exercise that led to product-line profitability information...
-
Write a recurrence relation describing the worst case running time of each the following algorithms and make a guess about the asymptotic complexity of the functions defined by the recurrence...
-
Calculate the support reactions at A and B for the beam subjected to the two linearly distributed loads. The reactions are positive if upward, negative if downward. 5.4 kN/m Answers -0.7 m 2.4 kN/m B...
-
Newlyweds' net worth Efram and Sofia, both aged 24, are newlyweds. Their after-tax salaries are $55 000 and $49 000, res-pectively. They have been renting a flat since they started work but have...
-
Can algorithms produce better hiring results than people can? Justify your position on this question.
-
What are the main distinctions between the different schools of legal interpretation?
-
What is a bill of lading?
-
What do the relational features restrict, project, and join mean?
-
What is the purpose of the blind copy of a purchase order?
-
Jenny Company begins the year with \($110,000\) of inventory and purchased an additional \($245.000\) of inventory during the year. At year end, a physical count of inventory revealed that Jenny...
-
Following are items reported on the financial statements of Microsoft Corporation as of June 30, 2017. of the reported accounts have been combined for simplicity.) Amounts given are in millions of...
-
On June 1, Musicland Inc. purchases 125 CDs at \($4.08\) each on account from its distributor for a total of \($510\). The credit terms of the purchase were 2/10, n/30. Also on June 1, Musicland paid...
Study smarter with the SolutionInn App