@Test public void testGetCharge() { assertEquals(0.0D, cpc.getCharge(-5), 1.0e-10); assertEquals(0.0, cpc.getCharge(0), 1.0e-10); assertEquals(1.5D, cpc.getCharge(1), 1.0e-10); assertEquals(1.5D, cpc.getCharge(2), 1.0e-10); assertEquals(1.5D, cpc.getCharge(3), 1.0e-10); assertEquals(3.0D, cpc.getCharge(4), 1.0e-10); assertEquals(151.5D, cpc.getCharge(103), 1.0e-10); }
@Override public double getCharge(int daysRented) { double result = 0; if (daysRented > 0) { result = 1.5; if (daysRented > 3) { result += (daysRented - 3) * 1.5; } } return result; }
ChildrenPriceCategory extends PriceCategory { @Override public double getCharge(int daysRented) { double result = 0; if (daysRented > 0) { result = 1.5; if (daysRented > 3) { result += (daysRented - 3) * 1.5; } } return result; } }
ChildrenPriceCategory extends PriceCategory { @Override public double getCharge(int daysRented) { double result = 0; if (daysRented > 0) { result = 1.5; if (daysRented > 3) { result += (daysRented - 3) * 1.5; } } return result; } private  ChildrenPriceCategory(); }
ChildrenPriceCategory extends PriceCategory { @Override public double getCharge(int daysRented) { double result = 0; if (daysRented > 0) { result = 1.5; if (daysRented > 3) { result += (daysRented - 3) * 1.5; } } return result; } private  ChildrenPriceCategory(); int getId(); @Override double getCharge(int daysRented); @Override String toString(); static ChildrenPriceCategory getInstance(); }
ChildrenPriceCategory extends PriceCategory { @Override public double getCharge(int daysRented) { double result = 0; if (daysRented > 0) { result = 1.5; if (daysRented > 3) { result += (daysRented - 3) * 1.5; } } return result; } private  ChildrenPriceCategory(); int getId(); @Override double getCharge(int daysRented); @Override String toString(); static ChildrenPriceCategory getInstance();  }