Assignment 2
Assignment 2
#include<iostream>
void showSelection(int);
void sellProduct(int);
void showSelection(int i)
num1 = 100;
num2 = 200;
num3 = 300;
num4 = 400;
cin>>i;
if (i==1)
else if (i==2)
else if (i==3)
{
else if (i==4)
else
class moneyRegister{
private:
int moneyOnHand;
public:
moneyRegister()
moneyOnHand = 500;
moneyRegister(int x)
moneyOnHand= x;
int getCurrentBalance()
return moneyOnHand;
{
cout<<"enter money: ";
cin>>moneyOnHand;
moneyOnHand +=amountIn;
cout << "Collect your item at the bottom and " << "enjoy." << endl;
};
class productType{
private:
public:
productType()
numberOfItems = 50;
cost = 50;
productType(int a, int b)
numberOfItems = a;
cost = b;
getNoOfItems()
return numberOfItems;
getcost()
return cost;
void makesale()
{
numberOfItems--;
};
int main()
int a;
showSelection(a);
moneyRegister R1;
R1.acceptAmount(500);
P1.makesale();
return 0;