#include<iostream>
using namespace std;
int getcoin()
{   int x;
	cout<<"Enter value of coin"<<endl;
	cin>>x;
	return x;
	
}
void calculateCoin(int &totalcoin,int coin)
{
	totalcoin+=coin;
	cout<<"Total amount coin right now is "<<totalcoin<<endl;
}
int calculateBalance(int totalcoin)
{
	int x;
	int price =120;
	x=totalcoin - price;
	cout << endl << "Your Balance is "<< x << endl;
	return x;
}
int main()
{
	int total=0,price=120,coin,balance;
	do{
		coin=(getcoin());
		(calculateCoin( total, coin));
	}while(total<price);
    balance=calculateBalance(total);
	if (balance>0)
	 cout<<"Please collect your balance ";
	 
	 cout<<"\nTERIMA KASIH ";
	
}
