Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class CharityEvent {
- public static void main(String[] args) {
- Scanner sladko = new Scanner(System. in);
- int countDays = Integer.parseInt(sladko.nextLine());
- int countChefs = Integer.parseInt(sladko.nextLine());
- int countCakes = Integer.parseInt(sladko.nextLine());
- int countWaffles = Integer.parseInt(sladko.nextLine());
- int countPancakes = Integer.parseInt(sladko.nextLine());
- int priceCake = 45;
- double priceWaffle = 5.80;
- double pricePancake = 3.20;
- double pechalba = countCakes*priceCake + countPancakes*pricePancake + countWaffles*priceWaffle;
- double obshto = pechalba*countChefs*countDays;
- double razhodi = obshto/8;
- double chisto = obshto - razhodi;
- System.out.printf("%.2f",chisto);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement