Advertisement
AngelKejov

Untitled

Mar 7th, 2021
101
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement