Advertisement
Spocoman

Christmas Preparation

Sep 3rd, 2024
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         double paperPrice = Integer.parseInt(scanner.nextLine()) * 5.80,
  7.                 clothPrice = Integer.parseInt(scanner.nextLine()) * 7.20,
  8.                 gluePrice = Double.parseDouble(scanner.nextLine()) * 1.20,
  9.                 discount = Integer.parseInt(scanner.nextLine()),
  10.                 totalPrice = (paperPrice + clothPrice + gluePrice) * (1.0 - discount / 100);
  11.  
  12.         System.out.printf("%.3f\n", totalPrice);
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement