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 1(100 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 per-unit cost of the item
The class should have the following public member functions.
Member Function
Description
default constructor
Sets all the member variables to 0
constructor #2
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 1
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): LastName_FirstInitial_Program1(example: Smith_J_Program_1).
Your class should be split properly into 2 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 3 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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!