Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- class Main {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- double days = Double.parseDouble (scanner.nextLine());
- int pastryCook = Integer.parseInt(scanner.nextLine());
- double cakesQuantity = Double.parseDouble (scanner.nextLine());
- double wafflesQuantity = Double.parseDouble (scanner.nextLine());
- double pancakesQuantity = Double.parseDouble (scanner.nextLine());
- double cakesSum = (cakesQuantity * 45);
- double wafflesSum = (wafflesQuantity * 5.80);
- double pancakesSum = (pancakesQuantity * 3.20);
- double totalSum_1day = (cakesSum + wafflesSum + pancakesSum)*8;
- double totalCampaign = (totalSum_1day * days);
- double rest = totalCampaign - (1/8 * totalCampaign);
- System.out.printf("%.2f", rest);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement