public class WaehrungTest {

    public static void main(String[] args) {
        Yen.setKurs(1.0 / 130);
        Euro.setKurs(1.0 / 1.05);
        Waehrung[] geld = new Waehrung[5];
        geld[0] = new USDollar(2500);
        geld[1] = new Yen(200000);
        geld[2] = new Euro(600);
        geld[3] = new USDollar(20);
        geld[4] = new Euro(500);
        double dollarGeldBetrag = berechneDollarGeldBetrag(geld);
        System.out.println(dollarGeldBetrag);
    }

    public static double berechneDollarGeldBetrag(Waehrung[] geld) {
        double summeInDollar = 0;
        for (Waehrung waehrung : geld) {
            summeInDollar += waehrung.dollarBetrag();
        }
        return summeInDollar;

    }

}