The purpose of this lab is to learn how to create a basic class object with member functions.
Program Requirements: Convert the structure from Lab 10 into a class.
Your class will have the same member variables as the structure for Lab 10,
but these variables will now be in the private
section of the
class. The global functions from Lab 10 will also be converted into member
functions of the class.
You will have the following functions in the public
section of the class:
ProductObject
. Update with the
class tag that you used for your class.
int main() { ProductObject p1, p2; cout << "Enter the information for product 1...\n"; p1.getProduct(); cout << "Enter the information for product 2...\n"; p2.getProduct(); cout << "\nProduct 1 information is:\n"; p1.printProduct(); cout << "\nProduct 2 information is:\n"; p2.printProduct(); return 0; }When the program is run, it should resemble the following (the user input is in blue font face):
Enter the information for product 1.... Enter product name: doll house Enter UPC code: 12345678901 Enter quantity in stock: 7 Enter the information for product 2.... Enter product name: red ball Enter UPC code: 12497438956 Enter quantity in stock: 15 Product 1 information is: Name: doll house UPC: 12345678901 Stock: 7 Product 2 information is: Name: red ball UPC: 12497438956 Stock: 15Name your code labEC.cpp and email your completed code to me.