Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class E01schoolSupplies {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double pens = Double.parseDouble(scanner.nextLine());
- double markers = Double.parseDouble(scanner.nextLine());
- double cleaner = Double.parseDouble(scanner.nextLine());
- double discount = Double.parseDouble(scanner.nextLine());
- double pensPrice = 5.80;
- double markersPrice = 7.20;
- double cleanerPrice = 1.20;
- double totalWhithouDiscount = (pens * pensPrice)+ (markers *markersPrice)+ (cleaner *cleanerPrice);
- double totalAll = totalWhithouDiscount - ((totalWhithouDiscount * discount) / 100);
- System.out.printf("%.3f", totalAll);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment