SHARE
TWEET

Untitled

a guest Sep 23rd, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. public int countNumberOfCars() {
  2.         int countCars = 0;
  3.         for (int i = 0; i < shortParkingSpace.length; i++) {
  4.             if (shortParkingSpace[i].getIcon() == carImg) {
  5.  
  6.                 countCars++;
  7.  
  8.             }
  9.         }
  10.         r.setNumberOfCars(countCars);
  11.         return countCars;
  12.     }
  13.  
  14.     public double addRevenue() {
  15.         double revenue = r.getNumberOfCars() * r.getCost();
  16.         return revenue;
  17.  
  18.     }
  19.  
  20.     public String revenueToString() {
  21.  
  22.         DecimalFormat df = new DecimalFormat("£0.00");
  23.         String s = df.format(addRevenue());
  24.        
  25.         return s;
  26.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top