Question: CSE 1325004 Homework #3 Using Classes In this homework, you will creat e a basic inventory system for an Auto Part warehouse. This will build
CSE 1325004 Homework #3 Using Classes In this homework, you will creat e a basic inventory system for an Auto Part warehouse. This will build off your HW3. A Sample Solution for HW3 will be provided once t he late submission window of HW3 has passed. 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 ma ny there are in the warehouse. The default constructor does nothing add_part will add a part to the ma p with an inventory number of 1. If that part is already present, it will increment the number of that part in the wareh ouse by 1. add_parts will add that part to t he inventory with the specifie d number. If that part is already present, it will increment the number of that part in the wareh ouse by the specified number. get_num_parts will return how man y of the specified part is in the warehouse remove_part will decrease the number of the specified part in t he warehouse by 1. After removing, if there are 0 left in the warehouse, r emove the Auto _Part from the list. remove_part will decrease the number of the specified part in t he warehouse by the specified number. After removing, if there are 0 or less than 0 in the wa rehouse, remove the Auto_Part from the list. operator<< will output the entir e inventory in the following fo rmat: 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< ove rloaded. This will return true if the left hand sides part number is less than the right hand sides part number (lhs < rhs). 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 fun ctions then just main) Create an inventory object. Ask the user how many Auto_Parts to create. Create a loop that runs as ma ny 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 t here 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 t hat 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 wis hes 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 wishe s 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 wishe s to remove and how many. Remov e 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.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
