Beispiel #1
0
 public override decimal Calculate(int hour)
 {
     if (hour > 24)
     {
         ParkingException pe = new ParkingException();
         throw pe;
     }
     else
     {
         decimal total = 0.00M;
         total = hour * 2;
         return(total);
     }
 }
Beispiel #2
0
 public override decimal Calculate(int parkingHours)
 {
     if (parkingHours > 24)
     {
         ParkingException pe = new ParkingException();
         throw pe;
     }
     else if (parkingHours <= 10)
     {
         return(2);
     }
     else
     {
         return(2 + (parkingHours - 10) * 2);
     }
 }