Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class CharitiCampaign {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int days = Integer.parseInt(scanner.nextLine());
- int cooks = Integer.parseInt(scanner.nextLine());
- int cakes = Integer.parseInt(scanner.nextLine());
- int waffles = Integer.parseInt(scanner.nextLine());
- int pancakes = Integer.parseInt(scanner.nextLine());
- double incomeCakes = days*cooks*cakes*45;
- double incomeWaffles = days*cooks*waffles*5.80;
- double incomePancakes = days*cooks*pancakes*3.20;
- double totalIncome = incomeCakes+incomePancakes+incomeWaffles;
- double result = totalIncome*7/8;
- System.out.printf("%.2f", result);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement