desislava_topuzakova

09. Yard Greening

Jan 8th, 2022
1,671
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.51 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class YardGreening {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double yardSize = Double.parseDouble(scanner.nextLine());
  7.         double yardPrice = yardSize*7.61;
  8.         double discount = yardPrice * 0.18;
  9.         double finalPrice = yardPrice - discount ;
  10.         System.out.println("The final price is: " + finalPrice + " lv.");
  11.         System.out.println("The discount is: "+ discount + " lv." );
  12.        
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment