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
|
#include"CashRegister.h"
#include "InventoryItem.h"
void main()
{
//use the inventory item class to create a database
//use array to store the name, units on hand and cost
//adjustable wrench, screwdriver, pliers, rachet, socket wrench (5 total)
const int AMT = 5;
InventoryItem tools[AMT] =
{
InventoryItem(), //using default constructor
InventoryItem("Screwdriver"), //using constructor 2
InventoryItem("Pliers", 3.75, 35),
InventoryItem("Rachet", 5.40, 10),
InventoryItem("Socket Wrench", 5.00, 7)
};
char toolA[DEFAULT_SIZE] = "Adjustable Wrench"; //using default constructor
tools[0].setDescription(toolA);
tools[0].setCost(4.75);
tools[0].setUnits(10);
tools[1].setCost(2.20); //usinf constructor 2
tools[1].setUnits(20);
//DISPLAY MENU
cout << left << "#" << setw(5) << "Item" << setw(20) << "qty on Hand" << endl;
cout << "----------------------------------------------------------------------";
system("pause");
}
|