import java.text.DecimalFormat;

// This is the Client class
public class Main {

    public static void main(String[] args) {

        ICurrencyFormatter account = new Adapter(50);
        System.out.println("This is the value in Euros: "+ account.getValueInEuros());
        System.out.println("This is the value in Yen:   " + account.getValueInYen());
     }
}

// This is our Target interface
interface ICurrencyFormatter
{
    String getValueInEuros();
    String getValueInYen();

}

// This is our Adapter that inherits from the Adaptee (SavingsAccount) and implements the Target
class Adapter extends SavingsAccount implements ICurrencyFormatter {
    private final double USD_TO_EUR_RATE  = 0.89;
    private final double USD_TO_YEN_RATE  = 111.80;

    public Adapter(double balance) {
        super(balance);
    }

    @Override
    public String getValueInEuros()
    {
        DecimalFormat numberFormat =  new DecimalFormat("€#.00;-€#.00");
        return numberFormat.format(getBalance() * USD_TO_EUR_RATE);
    }

    @Override
    public String getValueInYen()
    {
        DecimalFormat numberFormat =  new DecimalFormat("¥#.00;-¥#.00");
        return numberFormat.format(getBalance() * USD_TO_YEN_RATE);
    }
}