Advertisement
Guest User

Untitled

a guest
Sep 13th, 2019
214
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 CharitiCampaign {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. int days = Integer.parseInt(scanner.nextLine());
  7. int cooks = Integer.parseInt(scanner.nextLine());
  8. int cakes = Integer.parseInt(scanner.nextLine());
  9. int waffles = Integer.parseInt(scanner.nextLine());
  10. int pancakes = Integer.parseInt(scanner.nextLine());
  11.  
  12. double incomeCakes = days*cooks*cakes*45;
  13. double incomeWaffles = days*cooks*waffles*5.80;
  14. double incomePancakes = days*cooks*pancakes*3.20;
  15. double totalIncome = incomeCakes+incomePancakes+incomeWaffles;
  16. double result = totalIncome*7/8;
  17. System.out.printf("%.2f", result);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement