1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
#include <iostream>
#include <string>
using namespace std;
class Invoice {
private:
int partNum, quantity;
double price;
string partDescription;
public:
Invoice(int, string, int, double);
Invoice();
};
Invoice::Invoice(int num, string descrip, int quan, double cost)
{//class constructor
partNum = num;
partDescription = descrip;
quantity = quan;
price = cost;
}
Invoice::Invoice()
{
}
//initialize array of invoices
Invoice invoices[] =
{
new Invoice(83, "Electric sander", 7, 57.98),
new Invoice(24, "Power saw", 18, 99.99),
new Invoice(7, "Sledge hammer", 11, 21.5),
new Invoice(77, "Hammer", 76, 11.99),
new Invoice(39, "Lawn mower", 3, 79.5),
new Invoice(68, "Screwdriver", 106, 6.99),
new Invoice(56, "Jig saw", 21, 11.00),
new Invoice(3, "Wrench", 34, 7.5)
};
int main() {
system("pause");
return 0;
}
| |