Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1.  
  2. import java.net.SocketOption;
  3. import java.util.Scanner;
  4.  
  5. import static java.lang.Math.PI;
  6.  
  7. public class Demo {
  8. public static void main(String[] args) {
  9. Scanner scanner = new Scanner(System.in);
  10.  
  11. int days = Integer.parseInt(scanner.nextLine());
  12. int bakers = Integer.parseInt(scanner.nextLine());
  13. int cakes = Integer.parseInt(scanner.nextLine());
  14. int goffrets = Integer.parseInt(scanner.nextLine());
  15. int pancakes = Integer.parseInt(scanner.nextLine());
  16.  
  17.  
  18.  
  19. double cakePrice = 45;
  20. double goffretsPrice = 5.80;
  21. double pancakePrice = 3.20;
  22.  
  23. double sumPerDay = ((cakes * cakePrice) + (goffrets * goffretsPrice) + (pancakes * pancakePrice));
  24. double totalSum = sumPerDay * days;
  25. double finalSum = totalSum * 0.875;
  26.  
  27. System.out.printf("%.2f", finalSum);
  28.  
  29.  
  30.  
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement