#include<iostream>

using namespace std;

int total=0,price=120;

int getCoin ()
{
	int coin;
	cout<<"Enter the amount of coin you have => ";
	cin>>coin;
	
	return coin;
}

void calculateCoin (int &totalCoin , int coin)
{
	totalCoin+=coin;
	cout<<"\nThe amount of coin you have accumulated  is "<<totalCoin<<endl;
}

int calculateBalance(int totalcoin)
{
	int balance;
	balance=totalcoin-price;
	
	
	
	cout<<"Your balance is "<<balance<<endl;
	
	return balance;
	

}
int main()
{
	int c,B;
	
	do
	{
	
	c = getCoin();
	calculateCoin(total,c);
	
	if(total<price)
	cout<<"\nYou have entered insufficient amount of coin !\n"<<endl;
	
    }
	while(total<price);

    
    B=calculateBalance(total);
    
    if(B>0)
    {
	cout<<"=============================\n";
    cout<<"Please collect your balance  \n";
    cout<<"=============================\n";
    cout<<"       TERIMA KASIH          \n";
    cout<<"=============================  ";
    }
    else
    {
	cout<<"============================\n";
    cout<<"     TERIMA KASIH           \n";
    cout<<"============================  ";
    }
    
    
    return 0;
}
    
