Advertisement
SotirovG

YardGreening_09

Oct 28th, 2020
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.84 KB | None | 0 0
  1. package FirstStepsInCodingLab;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class YardGreening_09 {
  6.     public static void main(String[] args) {
  7.         Scanner scanner =new Scanner(System.in);
  8.         //1. създаваме си променлива
  9.         //2, 1 кв/м струва 7,61лв
  10.         //3, фирмата и прави 18% отстъпка от крайната цена
  11.         //4, кв/м за озеленяване са 550
  12.  
  13.         double squareMeters = Double.parseDouble(scanner.nextLine());
  14.  
  15.         double meterToGreening = squareMeters * 7.61;
  16.         double discount = meterToGreening - 0.18 * meterToGreening;
  17.         double lastPrice = meterToGreening - discount;
  18.         System.out.printf("The final price is: %.2f lv.",discount);
  19.  
  20.         System.out.printf("The discount is: %.2f lv.",lastPrice);
  21.  
  22.  
  23.  
  24.  
  25.  
  26.     }
  27. }
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement