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