Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public int countNumberOfCars() {
- int countCars = 0;
- for (int i = 0; i < shortParkingSpace.length; i++) {
- if (shortParkingSpace[i].getIcon() == carImg) {
- countCars++;
- }
- }
- r.setNumberOfCars(countCars);
- return countCars;
- }
- public double addRevenue() {
- double revenue = r.getNumberOfCars() * r.getCost();
- return revenue;
- }
- public String revenueToString() {
- DecimalFormat df = new DecimalFormat("£0.00");
- String s = df.format(addRevenue());
- return s;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement