@Test public void test_simpleInterest() { Double simpleInterest = Banking.simpleInterest(1000.0, 10.0, 2); assertThat(simpleInterest).isEqualTo(200.0); }
public static Double simpleInterest(Double principal, Double rateOfInterest, Integer years){ Objects.requireNonNull(principal, "Principal cannot be null"); Objects.requireNonNull(rateOfInterest, "Rate of interest cannot be null"); Objects.requireNonNull(years, "Years cannot be null"); return ( principal * rateOfInterest * years ) / 100; }
Banking { public static Double simpleInterest(Double principal, Double rateOfInterest, Integer years){ Objects.requireNonNull(principal, "Principal cannot be null"); Objects.requireNonNull(rateOfInterest, "Rate of interest cannot be null"); Objects.requireNonNull(years, "Years cannot be null"); return ( principal * rateOfInterest * years ) / 100; } }
Banking { public static Double simpleInterest(Double principal, Double rateOfInterest, Integer years){ Objects.requireNonNull(principal, "Principal cannot be null"); Objects.requireNonNull(rateOfInterest, "Rate of interest cannot be null"); Objects.requireNonNull(years, "Years cannot be null"); return ( principal * rateOfInterest * years ) / 100; }  }
Banking { public static Double simpleInterest(Double principal, Double rateOfInterest, Integer years){ Objects.requireNonNull(principal, "Principal cannot be null"); Objects.requireNonNull(rateOfInterest, "Rate of interest cannot be null"); Objects.requireNonNull(years, "Years cannot be null"); return ( principal * rateOfInterest * years ) / 100; }  static Double simpleInterest(Double principal, 
        Double rateOfInterest, Integer years); }
Banking { public static Double simpleInterest(Double principal, Double rateOfInterest, Integer years){ Objects.requireNonNull(principal, "Principal cannot be null"); Objects.requireNonNull(rateOfInterest, "Rate of interest cannot be null"); Objects.requireNonNull(years, "Years cannot be null"); return ( principal * rateOfInterest * years ) / 100; }  static Double simpleInterest(Double principal, 
        Double rateOfInterest, Integer years);  }