Lab 10 - Introduction to Classes

NOTE: This is an extra credit lab. It must be turned in before the final exam on Monday November 26th at 2:00pm to get the extra credit. You may still work in groups on this extra credit lab.

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:

The main() function should be the following (copy and paste into your code). This assumes the class is called 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: 15
Name your code labEC.cpp and email your completed code to me.