Question: The Inventory class First you will create two C++ files called abc1234_Inventory.h and abc1234_Inventory.cpp. See blackboard for a .png of the UML diagram. The map
The Inventory class
First you will create two C++ files called abc1234_Inventory.h and abc1234_Inventory.cpp. See blackboard for a .png of the UML diagram.
The map relates a part to how many there are in the warehouse.
The default constructor does nothing
add_part will add a part to the map with an inventory number of 1. If that part is already present, it will increment the number of that part in the warehouse by 1.
add_parts will add that part to the inventory with the specified number. If that part is already present, it will increment the number of that part in the warehouse by the specified number.
get_num_parts will return how many of the specified part is in the warehouse remove_part will decrease the number of the specified part in the warehouse by 1. After removing, if there are 0 left in the warehouse, remove the Auto_Part from the list. remove_part will decrease the number of the specified part in the warehouse by the specified number. After removing, if there are 0 or less than 0 in the warehouse, remove the Auto_Part from the list.
operator
o Auto Part 1 information Number in the warehouse.
o Auto Part 2 information Number in the warehouse.
o Etc.
Changes to Auto_Part Class
Second, you will modify the Auto_Part to have the operator
The main program
You will create C++ file called abc1234_main.cpp consisting of a main function. This main program consists of a main function that should do the following: (you may have to write more loops then what is listed below, or more functions then just main)
Create an inventory object.
Ask the user how many Auto_Parts to create.
Create a loop that runs as many times as the user states.
o For each iteration, ask the user for a type, name, part number, price, and how many there are in inventory.
o Create a part with those values.
o Add that part and how many there are to the inventory.
Output to terminal each part in the inventory.
Ask the user for the part he wishes to add one of. Add one of that part to the list. The part doesnt have to be in the list.
Output to terminal each part in the inventory.
Ask the user for the part he wishes to add more of and how many. Add that many of that part to the list. The part doesnt have to be in the list.
Output to terminal each part in the inventory.
Ask the user which part he wishes to remove one of. Remove one of that part from the list.
Output to terminal each part in the inventory.
Ask the user which part he wishes to remove and how many. Remove that many of that part from the list.
Output to terminal each part in the inventory.
Print out the average price for all parts in the list.
make sure your code can handle different numbers of Auto_Parts. Makefile You are REQUIRED to provide a simple makefile that can build AND execute your program given the command make.
full_credit folder
o abc1234_Auto_Part.h and abc1234_Auto_Part.cpp
o abc1234_Inventory.h and Inventory.cpp
o abc1234_main.cpp
o makefile
Auto Part pe: string part_number: int mapcInvento + Auto _Part() + Auto Part(t: string, n: string, pn: int, p : double) + get type(): string + get_name(): string + get_part_number): int + get_price(): double + set _type(t: string) + set_name(name : string) + set _part_numberipn: int) + set_price(p: double) + friend operator
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
