Question: Program 1 ( 1 0 0 Points toward Course Grade ) Design an Inventory class that can hold information for an item in a retail
Program Points toward Course Grade
Design an Inventory class that can hold information for an item in a retail store's inventory. The class should have the following private member variables.
Variable Name
Description
itemNumber
An int that holds the item's number
quantity
An int that holds the quantity of the item on hand
cost
A double that holds the wholesale perunit cost of the item
The class should have the following public member functions.
Member Function
Description
default constructor
Sets all the member variables to
constructor #
Accepts an item's number, quantity, and cost as arguments. Calls other class functions to copy these values into the appropriate member variables. Then calls the setTotalCost function
setItemNumber
Accepts an int argument and copies it into the itemNumber member variable
setQuantity
Accepts an int argument and copies it into the quantity member variable
setCost
Accepts a double argument and copies it into the cost member variable
getItemNumber
Returns the value in itemNumber
getQuantity
Returns the value in quantity
getCost
Returns the value in cost
getTotalCost
Computes and returns the totalCost
Demonstrate the class by writing a simple program that uses it This program should validate the user inputs to ensure that negative values are not accepted for the item number, quantity, or cost The program output should look like the picture below. Extra credit is given if you use the header file to create a more professional looking output display.
Programming Project
Create a UML diagram for the inventory class with RAPTOR and a flowchart that uses the class.
Name the Visual Studio Project folder replacing LastName and FirstInitial with YOUR name: LastNameFirstInitialProgramexample: SmithJProgram
Your class should be split properly into files: the specification h file and the implementation cpp file. Both of these files should be named the same as the class name.
Your client program should be split properly into files: the header h file, the main source file cpp and the function's source file cpp
Delete BOTH debug folders found inside your project use Windows Explorer to do this BEFORE zipping your project in the next step.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
