Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SuppliesForSchool {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int pensCount = Integer.parseInt(scanner.nextLine());
- int markersCount = Integer.parseInt(scanner.nextLine());
- int detergentLiters = Integer.parseInt(scanner.nextLine());
- int percentDiscount = Integer.parseInt(scanner.nextLine());
- //• Пакет химикали - 5.80 лв.
- //• Пакет маркери - 7.20 лв.
- //• Препарат - 1.20 лв (за литър)
- double pensPrice = pensCount * 5.80;
- double markersPrice = markersCount * 7.20;
- double detergentPrice = detergentLiters * 1.20;
- double totalSum = pensPrice + markersPrice + detergentPrice;
- double finalSum = totalSum - (totalSum * (percentDiscount/100.0));
- System.out.println(finalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement