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