コード例 #1
0
 /**
  * Adding data to cumulative daily sales report. hours cannot be less than 0 and fee cannot be
  * less than 1.50
  *
  * @param hours hours car was parked.
  * @param fee Fee's incurred during that time.
  * @throws NullOrEmptyArgumentException
  */
 @Override
 public final void addToSalesReport(double hours, double fee) throws NullOrEmptyArgumentException {
   if (hours <= 0 || fee < 1.50) {
     throw new NullOrEmptyArgumentException(
         " hours or fee is out of range: Sales Report addToSalesReport method");
   }
   try {
     salesReport.newCar(hours, fee);
   } catch (NullOrEmptyArgumentException e) {
     // endless try catch
     System.out.println(
         "Cannot pass hours of fee because one or more are null to new car method inside addToSalesReport");
   }
 }