@@ -0,0 +1,1419 @@
+package xyz.igorgee.mtaperfectfare;%0A%0A%0Apublic class Calculator %7B%0A%0A    public static final double BONUS_VALUE = 1.11;%0A    public static final double FARE = 2.75;%0A%0A    public static boolean areValidNumbers(int numberOfDays, int numberOfWeeks, int numberOfTrips, double amountInCard) %7B%0A        boolean result = true;%0A        if (numberOfDays %3C 1 %7C%7C numberOfDays %3E 7 %7C%7C numberOfWeeks %3C 1 %7C%7C numberOfWeeks %3E 4 %7C%7C numberOfTrips %3C 1 %7C%7C%0A                amountInCard %3C 0) %7B%0A            result = false;%0A        %7D%0A        return result;%0A    %7D%0A%0A    public static double calculateTotal(int numberOfDays, int numberOfWeeks, int numberOfTrips, double amountInCard) %7B%0A        double totalAmount;%0A        numberOfTrips *= numberOfDays * numberOfWeeks;%0A%0A        if ((FARE * numberOfTrips - amountInCard) / BONUS_VALUE %3E= 5.50) %7B%0A            totalAmount = ((FARE * numberOfTrips - amountInCard) / BONUS_VALUE);%0A        %7D else %7B%0A            totalAmount = ((FARE * numberOfTrips - amountInCard));%0A        %7D%0A%0A        // MTA Metrocard Vending Machine only allow payments in nickel increments%0A        int pennies = (int) Math.round(totalAmount * 100);%0A        int nickelDifference = pennies %25 10 - 5;%0A%0A        if (nickelDifference %3C 0 && nickelDifference != -5) %7B%0A            pennies += -nickelDifference;%0A        %7D else if (nickelDifference %3E 0) %7B%0A            pennies += 5 - nickelDifference;%0A        %7D%0A        return pennies / 100.0;%0A    %7D%0A%7D%0A

Create Calculator utility class