#include <iostream>
using namespace std;

int getcoin();
void calculateCoin(int &totalCoin, int coin);
int calculateBalance(int totalcoin, int pricce);

int main()
{
    int a, balance;
    int total=0, price=120;
    do
    {
        a=getcoin();
        calculateCoin(total, a);

    } while (total < price);
    
    balance=calculateBalance(total, price);

    if (balance > 0)
    {
        cout << "Please collect your balance" << endl;
    }
    else
    {
        cout << "TERIMA KASIH" << endl;
    }
    
    system("pause");
    return 0;
}

int getcoin()
{
	cout << "Enter the amount of the coin : ";
    int x;
    cin >> x;
    return x;
}

void calculateCoin(int &totalCoin, int coin)
{
    totalCoin += coin;
}

int calculateBalance(int totalcoin, int pricce)
{
    int balance;
    balance = totalcoin - pricce;
    return balance;
}
