CPP Classes and Objects
CPP Classes and Objects
1|P a ge
cout<<" "<<itemPrice[i];
}
cout<<"\n";
}
int main()
{
Items order; order.CNT(); int x;
do
{
cout<<"\n You can do the following;"<<"Enter appropriate number\n";
cout<<"\n1 : Add an Item";
cout<<"\n2 : Display Total Value";
cout<<"\n3 : Delete an Item";
cout<<"\n4 : Display all items";
cout<<"\n5 : Quit";
cout<<"\n\n What is your option?";
cin>>x;
switch(x)
{
case 1 : order.getitem(); break;
case 2 : order.displaySum(); break;
case 3 : order.remove(); break;
case 4 : order.displayItems(); break;
default : cout<<"Error in input";
}
}
while(x!=5);
return 0;
}
2|P a ge