Question: C++ Language Each bin in a warehouse holds a quantity of the same type of parts. Your program should use a structure that keeps the
C++ Language
Each bin in a warehouse holds a quantity of the same type of parts. Your program should use a structure that keeps the following data for each part:
Description of the part kept in the bin
Number of parts in the bin
Price of the part

When the program runs, it should repeat a loop that performs the following steps: The user should see a list of what each bin holds and how many parts are in each bin. The user can choose to either quit the program or select a bin. When a bin is selected, the user can either add parts to it or remove parts from it. The loop then repeats, showing the updated bin data on the screen.
When the user quits the program, the program should display a message indicating the total value of the current inventory, and which part has the maximum quantity. Please see sample output in the file output1.txt on the class website.
Note: your output should look at least as nice as mine (data lined up in columns, money formatted to two decimal points, etc). .
Your program must include four functions:
one to display the parts and quantity (NOT the prices),
one to process the users selection (to add or remove a certain number of parts for a given bin),
one to determine the total value of the current inventory, and
one to determine which part has the highest quantity.
Your program must give correct results for any valid input data. You should make it easy for another programmer to change the part names, quantity, prices, number of parts and if so the program should still give correct results.
Do not accept input that would make the quantity go below 0 (give an error message instead).
If more than one part shares the maximum quantity, your program should output any one of them.
Please do not use any features of C++ that we have not yet covered in class (use features from Chapters 1-7, 11 only). Do not use classes!
output1.txt
Parts Inventory 1 Chain 10 2 Handlebar 5 3 Pedals 15 4 Chainring 21 5 Cassette 7 6 Wheel 5 7 Saddle 5 8 Derailleur 25 9 Seat post 18 10 Tire 12 Select a bin or 11 to quit. 1 To add parts, enter A and the amount to add, To remove parts, enter R and the amount to remove: A 5 Parts Inventory 1 Chain 15 2 Handlebar 5 3 Pedals 15 4 Chainring 21 5 Cassette 7 6 Wheel 5 7 Saddle 5 8 Derailleur 25 9 Seat post 18 10 Tire 12 Select a bin or 11 to quit. 8 To add parts, enter A and the amount to add, To remove parts, enter R and the amount to remove: R 10 Parts Inventory 1 Chain 15 2 Handlebar 5 3 Pedals 15 4 Chainring 21 5 Cassette 7 6 Wheel 5 7 Saddle 5 8 Derailleur 15 9 Seat post 18 10 Tire 12 Select a bin or 11 to quit. 7 To add parts, enter A and the amount to add, To remove parts, enter R and the amount to remove: R 6 Error: not enough parts to remove Parts Inventory 1 Chain 15 2 Handlebar 5 3 Pedals 15 4 Chainring 21 5 Cassette 7 6 Wheel 5 7 Saddle 5 8 Derailleur 15 9 Seat post 18 10 Tire 12 Select a bin or 11 to quit. 12 Invalid selection. Parts Inventory 1 Chain 15 2 Handlebar 5 3 Pedals 15 4 Chainring 21 5 Cassette 7 6 Wheel 5 7 Saddle 5 8 Derailleur 15 9 Seat post 18 10 Tire 12 Select a bin or 11 to quit. 10 To add parts, enter A and the amount to add, To remove parts, enter R and the amount to remove: A 3 Parts Inventory 1 Chain 15 2 Handlebar 5 3 Pedals 15 4 Chainring 21 5 Cassette 7 6 Wheel 5 7 Saddle 5 8 Derailleur 15 9 Seat post 18 10 Tire 15 Select a bin or 11 to quit. 11 Total value of current inventory: $1504.39 Part with the maximum quantity: Chainring
Part Description Quantity Price Chain 8.99 19.95 Handlebar Pedals 15 7.99 Chainring 21 8.99 10.99 Cassette Wheel 53.99 Saddle 29.95 Derailleur 25 11.99 Seat post 18 7.49 Tire 12 9.99
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
