@@ -0,0 +1,1875 @@
+package com.andela.currencycalculator.calculatorbrain;%0A%0Aimport com.andela.currencycalculator.model.currency.Currency;%0A%0Aimport java.text.DecimalFormat;%0Aimport java.util.ArrayList;%0Aimport java.util.HashMap;%0A%0A/**%0A * Created by Spykins on 26/02/2016.%0A */%0Apublic class CurrencyConverter%7B%0A%0A    HashMap%3CString, Double%3EcurrencyAndExchangeRate;%0A%0A    public  CurrencyConverter()%7B%0A        currencyAndExchangeRate = new HashMap%3C%3E();%0A    %7D%0A%0A    public String exchangeFromCurrencyTo(String convertFrom, String convertTo, String amount)%7B%0A%0A        double answer = 0;%0A        DecimalFormat decimalFormat = new DecimalFormat(%22.##%22);%0A        if(currencyAndExchangeRate.containsKey(convertFrom) &&%0A                currencyAndExchangeRate.containsKey(convertTo))%7B%0A            answer = performCalculation(convertFrom,convertTo,amount);%0A        %7D%0A        if(answer == 0)%7B%0A            return %220%22;%0A        %7Delse if(answer %3C 1)%7B%0A           return  0 + String.valueOf(decimalFormat.format(answer));%0A        %7D%0A%0A        return String.valueOf(decimalFormat.format(answer));%0A    %7D%0A%0A    private double performCalculation(String convertFrom, String convertTo, String amount)%7B%0A%0A        double answer;%0A        if(amount.equals(%220%22) %7C%7C amount.equals(%22%22))%7B%0A            return 0;%0A        %7D%0A        double inputExchangeRateToDollar = currencyAndExchangeRate.get(convertFrom);%0A        double amountConverting = Double.parseDouble(amount);%0A        double inputInDollar = amountConverting/inputExchangeRateToDollar;%0A%0A        double outputExchangeRateToDollar = currencyAndExchangeRate.get(convertTo);%0A        answer = inputInDollar * outputExchangeRateToDollar;%0A        return answer;%0A    %7D%0A%0A    public void setAllCurrencyInDb(ArrayList%3CCurrency%3E currencies)%7B%0A        for (Currency currency : currencies)%7B%0A            currencyAndExchangeRate.put(currency.getCurrency(),currency.getExchangeRate());%0A        %7D%0A    %7D%0A%0A%7D%0A

Implement currency converter class