stoyanoff

09. Yard Greening

Jun 9th, 2020
1,132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class YardGreening {
  4.     public static void main(String[] args) {
  5.         Scanner myScan = new Scanner(System.in);
  6.         double area = Double.parseDouble(myScan.nextLine());
  7.  
  8.         double totalPrice = area * 7.61;
  9.         double discount = 0.18 * totalPrice;
  10.         double finalPrice = totalPrice - discount;
  11.  
  12.         System.out.printf("The final price is: %s lv. \n", finalPrice);
  13.  
  14.         System.out.printf("The discount is: %s lv.", discount);
  15.  
  16.  
  17.  
  18.     }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment