Advertisement
Guest User

Untitled

a guest
Jan 19th, 2020
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class CharityEvent {
  4. public static void main(String[] args) {
  5. Scanner sladko = new Scanner(System. in);
  6.  
  7. int countDays = Integer.parseInt(sladko.nextLine());
  8. int countChefs = Integer.parseInt(sladko.nextLine());
  9. int countCakes = Integer.parseInt(sladko.nextLine());
  10. int countWaffles = Integer.parseInt(sladko.nextLine());
  11. int countPancakes = Integer.parseInt(sladko.nextLine());
  12. int priceCake = 45;
  13. double priceWaffle = 5.80;
  14. double pricePancake = 3.20;
  15.  
  16.  
  17. double pechalba = countCakes*priceCake + countPancakes*pricePancake + countWaffles*priceWaffle;
  18. double obshto = pechalba*countChefs*countDays;
  19. double razhodi = obshto/8;
  20. double chisto = obshto - razhodi;
  21.  
  22. System.out.printf("%.2f",chisto);
  23.  
  24. }
  25. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement