Skip to content
Open

idk #19

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

public interface ConvertableCurrency {
default Double convert(CurrencyType currencyType) {
return Double.MAX_VALUE;
return currencyType.getRate() / this.getCurrencyType().getRate(); // return Double.MAX_VALUE;
}

CurrencyType getCurrencyType();
}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ public Double getRate() {
}

public static CurrencyType getTypeOfCurrency(ConvertableCurrency currency) {
return null;
return currency.getCurrencyType();
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
package io.zipcoder.currencyconverterapplication.currencies;

import io.zipcoder.currencyconverterapplication.ConvertableCurrency;
import io.zipcoder.currencyconverterapplication.CurrencyType;

public class AustralianDollar implements ConvertableCurrency {

@Override
public Double convert(CurrencyType currencyType) {
return ConvertableCurrency.super.convert(currencyType);
}

@Override
public CurrencyType getCurrencyType() {
return CurrencyType.AUSTRALIAN_DOLLAR;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
package io.zipcoder.currencyconverterapplication.currencies;

import io.zipcoder.currencyconverterapplication.ConvertableCurrency;
import io.zipcoder.currencyconverterapplication.CurrencyType;

public class CanadianDollar implements ConvertableCurrency {
@Override
public Double convert(CurrencyType currencyType) {
return ConvertableCurrency.super.convert(currencyType);
}

@Override
public CurrencyType getCurrencyType() {
return CurrencyType.CANADIAN_DOLLAR;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
package io.zipcoder.currencyconverterapplication.currencies;

import io.zipcoder.currencyconverterapplication.ConvertableCurrency;
import io.zipcoder.currencyconverterapplication.CurrencyType;

public class ChineseYR implements ConvertableCurrency {


@Override
public CurrencyType getCurrencyType() {
return CurrencyType.CHINESE_YR;
}


}
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
package io.zipcoder.currencyconverterapplication.currencies;

import io.zipcoder.currencyconverterapplication.ConvertableCurrency;
import io.zipcoder.currencyconverterapplication.CurrencyType;

public class Euro implements ConvertableCurrency {
@Override
public Double convert(CurrencyType currencyType) {
return ConvertableCurrency.super.convert(currencyType);
}

@Override
public CurrencyType getCurrencyType() {
return CurrencyType.EURO;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
package io.zipcoder.currencyconverterapplication.currencies;

import io.zipcoder.currencyconverterapplication.ConvertableCurrency;
import io.zipcoder.currencyconverterapplication.CurrencyType;

public class Franc implements ConvertableCurrency {
@Override
public Double convert(CurrencyType currencyType) {
return ConvertableCurrency.super.convert(currencyType);
}

@Override
public CurrencyType getCurrencyType() {
return CurrencyType.FRANC;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
package io.zipcoder.currencyconverterapplication.currencies;

import io.zipcoder.currencyconverterapplication.ConvertableCurrency;
import io.zipcoder.currencyconverterapplication.CurrencyType;

public class Pound implements ConvertableCurrency {
@Override
public Double convert(CurrencyType currencyType) {
return ConvertableCurrency.super.convert(currencyType);
}

@Override
public CurrencyType getCurrencyType() {
return CurrencyType.POUND;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
package io.zipcoder.currencyconverterapplication.currencies;

import io.zipcoder.currencyconverterapplication.ConvertableCurrency;
import io.zipcoder.currencyconverterapplication.CurrencyType;

public class Ringgit implements ConvertableCurrency {
@Override
public Double convert(CurrencyType currencyType) {
return ConvertableCurrency.super.convert(currencyType);
}

@Override
public CurrencyType getCurrencyType() {
return CurrencyType.RINGGIT;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
package io.zipcoder.currencyconverterapplication.currencies;

import io.zipcoder.currencyconverterapplication.ConvertableCurrency;
import io.zipcoder.currencyconverterapplication.CurrencyType;

public class Rupee implements ConvertableCurrency {
@Override
public Double convert(CurrencyType currencyType) {
return ConvertableCurrency.super.convert(currencyType);
}

@Override
public CurrencyType getCurrencyType() {
return CurrencyType.RUPEE;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
package io.zipcoder.currencyconverterapplication.currencies;

import io.zipcoder.currencyconverterapplication.ConvertableCurrency;
import io.zipcoder.currencyconverterapplication.CurrencyType;

public class SingaporeDollar implements ConvertableCurrency {
@Override
public Double convert(CurrencyType currencyType) {
return ConvertableCurrency.super.convert(currencyType);
}

@Override
public CurrencyType getCurrencyType() {
return CurrencyType.SINGAPORE_DOLLAR;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
package io.zipcoder.currencyconverterapplication.currencies;

import io.zipcoder.currencyconverterapplication.ConvertableCurrency;
import io.zipcoder.currencyconverterapplication.CurrencyType;

public class USDollar implements ConvertableCurrency {

public USDollar(){

}


@Override
public CurrencyType getCurrencyType() {
return CurrencyType.US_DOLLAR;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
package io.zipcoder.currencyconverterapplication.currencies;

import io.zipcoder.currencyconverterapplication.ConvertableCurrency;
import io.zipcoder.currencyconverterapplication.CurrencyType;

public class UniversalCurrency implements ConvertableCurrency {
@Override
public Double convert(CurrencyType currencyType) {
return ConvertableCurrency.super.convert(currencyType);
}

@Override
public CurrencyType getCurrencyType() {
return CurrencyType.UNIVERSAL_CURRENCY;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
package io.zipcoder.currencyconverterapplication.currencies;

import io.zipcoder.currencyconverterapplication.ConvertableCurrency;
import io.zipcoder.currencyconverterapplication.CurrencyType;

public class Yen implements ConvertableCurrency {


public Yen() {

}

{

}

@Override
public CurrencyType getCurrencyType() {
return CurrencyType.YEN;
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.