#include<iostream>  // JACK LEE /990212-01-5315/ A19EC0057 / SECTION 07 / 12.11.2019
using namespace std; // MUHAMMAD SUHAIL / C0082352 / A19EC0269 / SECTION 07 / 12.11.2019
int getCoin();
void calculatecoin (int&totalCoin, int coin);
int calculateBalance (int totalcoin);

int getCoin()
{
	int v ;
	cout << "Enter the value of the coin" << endl ;
	cin >> v ;
	
	return v ;
}

void calculatecoin (int&totalCoin, int coin)
{
	totalCoin = totalCoin + coin ;
	
	cout << "\nTotal coin = " << totalCoin << endl ;
}

int calculateBalance (int totalcoin)
{
	totalcoin = totalcoin - 120 ;
	cout <<"\nBalance = " << totalcoin << endl ;
}

int main ()
{
	int price = 120 , totalCoin = 0 , coin, balance ;
	coin = getCoin() ;
	calculatecoin (totalCoin, coin) ;
	while(totalCoin < price)
	{
		coin = getCoin() ;
		calculatecoin (totalCoin, coin) ;
	}
	balance = calculateBalance (totalCoin) ;
	if (balance>0)
	{
		cout << "\nPlease collect your balance" << endl ;
	}
	cout << "TERIMA KASIH" << endl ;
	
	return 0 ;
}
