Advertisement
Guest User

Untitled

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