Advertisement
GabrielHr00

05. Supplies for School

Mar 10th, 2024
523
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.75 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class SuppliesForSchool {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int pensCount = Integer.parseInt(scanner.nextLine());
  7.         int markersCount = Integer.parseInt(scanner.nextLine());
  8.         int detergentLiters = Integer.parseInt(scanner.nextLine());
  9.         int discountPercent = Integer.parseInt(scanner.nextLine());
  10.  
  11.         double pensSum = pensCount * 5.80;
  12.         double markersSum = markersCount * 7.20;
  13.         double detergentSum = detergentLiters * 1.20;
  14.  
  15.         double totalSum = pensSum + markersSum + detergentSum;
  16.  
  17.         double finalSum = totalSum - (totalSum * (discountPercent/100.0));
  18.         System.out.println(finalSum);
  19.     }
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement