Advertisement
Guest User

Untitled

a guest
Jan 14th, 2020
569
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. package com.company;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class SquareArea {
  6.     public static void main(String[] args) {
  7.         Scanner scanner = new Scanner(System.in);
  8.         double price = Double.parseDouble(scanner.nextLine());
  9.         double priceForYard = price * 7.61;
  10.         double discount = priceForYard * 0.18;
  11.         double finalPrice = priceForYard - discount;
  12.  
  13.         System.out.printf("The final price is: %.2f lv.%nThe discount is: %.2f lv.",finalPrice,discount);
  14.  
  15.     }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement