mber variables to 0 n's number, quantity, and cost as arguments. Calls tions to copy these values into the appropriate es. Then calls the setTotalCost function argument and copies it into the itemNumber member argument and copies it into the quantity member le argument and copies it into the cost member ue in itemNumber e in quantity e in cost returns the totalCost bed in the previous question. It should only contain the declaration code as taught by this lesson. eader file you created in the previous question. It should only contain the definition code as taught by this lesson. u created in the previous questions to demonstrate its usage. two .cpp files as taught by this lesson. ction and the other .cpp file will contain function definitions that match the declarations in the paired header file. unctions that receive or return an object of type ItemsInStock. nputs to ensure that negative values are not accepted for item number, quantity, or cost. similar to the example below:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

The C++ code show work in C++ builder !!!

●
Design an Stock class that can hold information for a store's inventory.
The class should have the following private member variables.
●
Variable Name
itemNumber
quantity
cost
Member Function
default constructor
• The class should have the following public member functions.
constructor #2
setltemNumber
setQuantity
setCost
getltemNumber
getQuantity
getCost
Description
getTotalCost
An int that holds the item's number
An int that holds the quantity of the item on hand
A double that holds the wholesale per-unit cost of the item
Description
Sets all the member variables to 0
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
Accepts an int argument and copies it into the itemNumber member
variable
Accepts an int argument and copies it into the quantity member
variable
Accepts a double argument and copies it into the cost member
variable
Returns the value in itemNumber
Returns the value in quantity
Returns the value in cost
• Create a C++ header file for the class described in the previous question. It should only contain the declaration code as taught by this lesson.
Create a C++ .cpp file for the class whose header file you created in the previous question. It should only contain the definition code as taught by this lesson.
Create a C++ client program for the class you created in the previous questions to demonstrate its usage.
O
It should consist of one header file and two .cpp files as taught by this lesson.
• One.cpp file will contain the main() function and the other .cpp file will contain function definitions that match the declarations in the paired header file.
• The program should have at least two functions that receive or return an object of type ItemsInStock.
. This program should validate the user inputs to ensure that negative values are not accepted for item number, quantity, or cost.
• As a minimum, program output should similar to the example below:
Computes and returns the totalCost
Transcribed Image Text:● Design an Stock class that can hold information for a store's inventory. The class should have the following private member variables. ● Variable Name itemNumber quantity cost Member Function default constructor • The class should have the following public member functions. constructor #2 setltemNumber setQuantity setCost getltemNumber getQuantity getCost Description getTotalCost An int that holds the item's number An int that holds the quantity of the item on hand A double that holds the wholesale per-unit cost of the item Description Sets all the member variables to 0 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 Accepts an int argument and copies it into the itemNumber member variable Accepts an int argument and copies it into the quantity member variable Accepts a double argument and copies it into the cost member variable Returns the value in itemNumber Returns the value in quantity Returns the value in cost • Create a C++ header file for the class described in the previous question. It should only contain the declaration code as taught by this lesson. Create a C++ .cpp file for the class whose header file you created in the previous question. It should only contain the definition code as taught by this lesson. Create a C++ client program for the class you created in the previous questions to demonstrate its usage. O It should consist of one header file and two .cpp files as taught by this lesson. • One.cpp file will contain the main() function and the other .cpp file will contain function definitions that match the declarations in the paired header file. • The program should have at least two functions that receive or return an object of type ItemsInStock. . This program should validate the user inputs to ensure that negative values are not accepted for item number, quantity, or cost. • As a minimum, program output should similar to the example below: Computes and returns the totalCost
C. C:\Windows\system32\cmd.exe
Demonstrating the default constructor...
Item number: 0
Quantity
Cost
: 0.00
Total Cost: 0.00
Demonstrating the overloaded constructor...
Item number: 124
Quantity : 12
Cost
Total Cost: 1019.40
: 84.95
Demonstrating the "set" functions...
Item number: 243
Quantity : 50
Cost
Total Cost: 475.00
= 9.50
Demonstrating the input validation functions...
Item Number must be or greater. Please re-enter: 25
Quantity must be or greater. Please re-enter: 145
Cost must be or greater. Please re-enter: 15.00
Item number: 25
Quantity : 145
Cost
Total Cost: 2175.00
Press any key to continue...
: 15.00
x
E
Transcribed Image Text:C. C:\Windows\system32\cmd.exe Demonstrating the default constructor... Item number: 0 Quantity Cost : 0.00 Total Cost: 0.00 Demonstrating the overloaded constructor... Item number: 124 Quantity : 12 Cost Total Cost: 1019.40 : 84.95 Demonstrating the "set" functions... Item number: 243 Quantity : 50 Cost Total Cost: 475.00 = 9.50 Demonstrating the input validation functions... Item Number must be or greater. Please re-enter: 25 Quantity must be or greater. Please re-enter: 145 Cost must be or greater. Please re-enter: 15.00 Item number: 25 Quantity : 145 Cost Total Cost: 2175.00 Press any key to continue... : 15.00 x E
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY