Advertisement
AngelKejov

Untitled

Mar 7th, 2021
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.55 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class YardGreening {
  6.  
  7.     public static void main(String[] args) {
  8.         Scanner sc = new Scanner(System.in);
  9.  
  10.         int kvMeters = Integer.parseInt(sc.nextLine());
  11.         double priceForGreening = kvMeters * 7.61;
  12.         double priceWithDiscount = priceForGreening * 0.18;
  13.  
  14.         double finalPrice = priceForGreening - priceWithDiscount;
  15.         System.out.printf("The final price is: %.2f lv.\n" +
  16.                 "The discount is: %.2f lv", finalPrice, priceWithDiscount);
  17.     }
  18. }
  19.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement