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) {
- double penPrice = 5.80;
- double markerPrice = 7.20;
- double detergentPrice = 1.20;
- Scanner scanner = new Scanner(System.in);
- int penCount = Integer.parseInt(scanner.nextLine());
- int markerCount = Integer.parseInt(scanner.nextLine());
- int detergentCount = Integer.parseInt(scanner.nextLine());
- double discount = Double.parseDouble(scanner.nextLine());
- double totalPrice = (1 - discount / 100) * (penCount * penPrice + markerCount * markerPrice + detergentCount * detergentPrice);
- System.out.println(totalPrice);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement