Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package HomeWork;
- import java.util.Scanner;
- public class CharityCampaign {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- // Вход
- int dayOfCampaign = Integer.parseInt(scanner.nextLine());
- int numberOfConfectioner = Integer.parseInt(scanner.nextLine());
- int countOfCakes = Integer.parseInt(scanner.nextLine());
- int countOfWaffles = Integer.parseInt(scanner.nextLine());
- int countOfPancakes = Integer.parseInt(scanner.nextLine());
- // Пресмятане
- double cakePrice = 45.00;
- double wafflePrice = 5.8;
- double panCakePrice = 3.2;
- double earnedPerChefForDayCakes = countOfCakes * cakePrice;
- double earnedPerChefForDayWaffles = countOfWaffles * wafflePrice;
- double earnedPerChefForDayPanCakes = countOfPancakes * panCakePrice;
- double totalPriceAllChefs = (earnedPerChefForDayCakes + earnedPerChefForDayPanCakes + earnedPerChefForDayWaffles) * 8;
- double moneyEarnedEntireCampaign = totalPriceAllChefs * dayOfCampaign;
- double amountAfterCoveringTheCosts = moneyEarnedEntireCampaign - (moneyEarnedEntireCampaign / numberOfConfectioner);
- // Принт
- System.out.printf("%.2f", amountAfterCoveringTheCosts);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement