galinyotsev123

ProgBasicsExam1and2December2018-E01schoolSupplies

Dec 29th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class E01schoolSupplies {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. double pens = Double.parseDouble(scanner.nextLine());
  8. double markers = Double.parseDouble(scanner.nextLine());
  9. double cleaner = Double.parseDouble(scanner.nextLine());
  10. double discount = Double.parseDouble(scanner.nextLine());
  11.  
  12. double pensPrice = 5.80;
  13. double markersPrice = 7.20;
  14. double cleanerPrice = 1.20;
  15.  
  16. double totalWhithouDiscount = (pens * pensPrice)+ (markers *markersPrice)+ (cleaner *cleanerPrice);
  17. double totalAll = totalWhithouDiscount - ((totalWhithouDiscount * discount) / 100);
  18.  
  19. System.out.printf("%.3f", totalAll);
  20.  
  21. }
  22. }
Advertisement
Add Comment
Please, Sign In to add comment