#include <iostream>
using namespace std ;

int getcoin ()
{
	int c ;
	
	cout << "Please enter the value of coin = " ;
	cin >> c ;
	
	return c ;
}

void calculateCoin (int &totalCoin, int coin)
{
	totalCoin += coin ;

	cout << "Total amount of coins = " << totalCoin << endl << endl ;
	
}

int calculateBalance (int totalcoin)
{
	int price = 120 , balance ;
	
	balance = totalcoin - price ;
	
	cout << "The balance is " << balance << endl ;
	
	return balance ;
	
}

int main ()
{
	int totalCoin = 0 , price = 120 , c , Balance ;
	
	do
	{
	c = getcoin () ;
	calculateCoin (totalCoin,c) ;
	}while (totalCoin < price) ;
	
	Balance = calculateBalance (totalCoin) ;
	
	if (Balance > 0)
		cout << "Please collect your balance" << endl ;
		
	cout << "TERIMA KASIH" ;
	
	return 0 ;
	
}
