Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class SuppliesForSchool_01 {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int countPens= Integer.parseInt(scanner.nextLine());
- int countMarkers = Integer.parseInt(scanner.nextLine());
- double litersCleaner = Double.parseDouble(scanner.nextLine());
- int discount = Integer.parseInt(scanner.nextLine());
- //Пакет химикали - 5.80 лв
- //Пакет маркери - 7.20 лв
- //Препарат - 1.20 лв (за литър)
- double pricePens = countPens * 5.80;
- double priceMarkers = countMarkers * 7.20;
- double priceCleaner = litersCleaner * 1.20;
- double totalPrice = pricePens + priceMarkers + priceCleaner;
- double priceWithDiscount = totalPrice - (totalPrice * discount) / 100;
- System.out.printf("%.3f", priceWithDiscount);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement