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...
-
The table shows the top ten popular breeds of dogs in 2012 according to the American Kennel Club. The breeds are listed in the order of number of registrations. 1. Which breed has more dogs...
-
Selected transactions completed by Kornett Company during its first fiscal year ended December 31, 2014, were as follows: Jan. 3. Issued a check to establish a petty cash fund of $4,500. Feb. 26....
-
The United States and Canada are two of only 33 countries that have jus soli, the right to citizenship of any individual born on their soil. Why do you think this right is so limited, and do you...
-
Primare Corporation has provided the following data concerning last month's manufacturing operations. Required: 1. Prepare a schedule of cost of goods manufactured for the month. 2. Prepare a...
-
Watch and analyze this YouTube video: Troy Aikman - Economics of the NFLfrom the beginning to at least the 45:00 mark. The video addresses economics in the NFL today. YouTube URL:...
-
Using License Fees to Make Positive Profit: Suppose you own one of many identical pharmaceudical companies producing a particular drug x. A: Your production process has decreasing returns to scale...
-
Pharoah Electronics issues a $393,500, 5%, 15-year mortgage note on December 31, 2019. The proceeds from the note are to be used in financing a new research laboratory. The terms of the note provide...
-
Find a recent news report about a statistical study whose results you dont believe are meaningful and important. In one page or less, summarize the study and explain why you dont believe its claims.
-
Number of cars crossing the Golden Gate Bridge each hour. State whether the data described are discrete or continuous and explain why?
-
The lengths in minutes of each of the flights between San Francisco and Atlanta in the past month. State whether the data described are discrete or continuous and explain why?
-
Find the Nielsen ratings for the past week. What were the three most popular television shows? Explain the meaning of the rating and the share for each show.
-
The times required by students to complete a statistics test. State whether the data described are discrete or continuous and explain why?
-
Angela purchased a new printing machine and started a small printing shop. As per his calculations, to earn revenue of $6,000 per month, he needs to sell printouts of 24,000 sheets per month.? The...
-
Willingness to pay as a measure of a person's value for a particular good measures the maximum a person would be willing to pay requires that payment actually be made depends on the satisfaction that...
-
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?
-
Find the acceleration of a fluid particle for the following velocity profiles: (a) \(v_{x}=A\left(1-y^{2} ight) ; v_{y}=0 ; v_{z}=0\) (b) \(v_{x}=A x ; v_{y}=-A y ; v_{z}=0\) (c) \(v_{r}=0 ;...
-
Pervaporation: a case-study problem. Pervaporation refers to removal of the permeate as vapor and represents an intermediate case between purely gas transport and purely liquid transport in a...
-
Develop a simple backmixed model to evaluate the performance of a gas-separation system. Here a feed gas enters a high-pressure chamber with a mole fraction of A of \(x_{\mathrm{Af}}\) and leaves...
Study smarter with the SolutionInn App