I just purchased Ivor Horton's "Beginning Visual C++ 2010" e-book and was attempting one of the practice problems (of which I do not have the solution) and was wondering if anyone be willing to help me write this (so called) simple C++ program in Visual Studio 2010? If possible, I would want comments beside each important section so that I may better understand the process of how the program works.
Here is the program requirements...
Practice Exercise #1
Program Input
The input to the program will be the product id number (a 5-digit identification number), the manufacturer's id number (a 4-digit identification number), the wholesale price of the
product, the mark-up percentage for the product, the description of the product, and the quantity of product in stock.
The following is an example of this input:
Product ID #: 10001
Manufacturer's ID #: 5020
Wholesale Price: 15.00
Mark-Up %: .20
Product Description: 3.5" Floppy Disks
Quantity In Stock: 140
Output
Prepare a listing of the inventory for the store with appropriate column headings. This listing should include the following:
a. the product id number; integer
b. the product description; character
c. the manufacturer's id number; integer
d. the wholesale price of the product; double
e. the mark-up percentage for the product; double
f. the quantity of product in inventory. integer
The retail price for the product (the wholesale price increased by the mark-up percentage) should be printed as a separate item from the above listing.
Processing
1. The class variables, which represent a single product sold by the store, should include the following data members:
(6 private members)
a. the product id number integer
b. the description of the product character array
c. the manufacturer's id number integer
d. the wholesale price of the product double
e. the mark-up percentage for the product double
f. the quantity of product in inventory integer
2. The class should have the following member functions:
(10 public members)
a. Two constructors. The first is the default, which sets all of the members of the class to zero. The second constructor should enable the user to specify all of the initial attributes of the members of the class.
b. Separate functions which return the values of the members of the class.
c. A function that displays the values of the members of the class to the monitor (as described in the "output" section).
d. A function that returns the class object's retail price (the wholesale price increased by the mark-up percentage).