Advertisement
Spocoman

09. Yard Greening

Aug 21st, 2024
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.47 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class YardGreening {
  4.     public static void main(String[] args) {
  5.  
  6.  
  7.         Scanner scanner = new Scanner(System.in);
  8.         double yard = Double.parseDouble(scanner.nextLine());
  9.  
  10.         double sum = yard * 7.61;
  11.         double price = sum * 0.82;
  12.         double discount = sum * 0.18;
  13.  
  14.         System.out.printf("The final price is: %.2f lv.", price);
  15.         System.out.printf("The discount is: %.2f lv.", discount);
  16.     }
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement