Advertisement
Deiancom

Untitled

Jun 21st, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.45 KB | None | 0 0
  1. if (litersFuel >= 20 && litersFuel <= 25) {
  2.             double discount = fuelPrice * 0.08;
  3.             fuelPrice = fuelPrice - discount;
  4.         }else if (litersFuel > 25) {
  5.             double discount = fuelPrice * 0.10;
  6.             fuelPrice = fuelPrice - discount;
  7.         }else {
  8.             fuelPrice = fuelPrice;
  9.         }
  10.         double endPriceOfFuel = fuelPrice * litersFuel;
  11.         System.out.printf("%.2f lv.", endPriceOfFuel);
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement