Advertisement
Ivakis

Благотворителна кампания

Sep 14th, 2017
122
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class demo {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6.  
  7. int days = Integer.parseInt(scanner.nextLine());
  8. int bakers = Integer.parseInt(scanner.nextLine());
  9. int cakes = Integer.parseInt(scanner.nextLine());
  10. int waffles = Integer.parseInt(scanner.nextLine());
  11. int panecakes = Integer.parseInt(scanner.nextLine());
  12.  
  13.  
  14. double cakesSum = cakes * 45;
  15. double wafflesSum = waffles * 5.80;
  16. double panecakesSum = panecakes * 3.20;
  17.  
  18. double sumPerDay = (cakesSum + wafflesSum + panecakesSum) * bakers;
  19.  
  20. double total = sumPerDay * days;
  21.  
  22. double result = total - total / 8;
  23.  
  24. System.out.printf("%.2f", result);
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement