Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class Main {
- 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 pancakes = Integer.parseInt(scanner.nextLine());
- double cakeProfit = cakes * 45;
- double wafflesProfit = waffles * 5.80;
- double pancakesProfit = pancakes * 3.20;
- double profitPerDayByOne = cakeProfit + wafflesProfit + pancakesProfit;
- double profitPerDayAll = profitPerDayByOne * 8;
- double totalProfits= profitPerDayAll * days;
- double expenses = totalProfits - 1/8 ;
- double finalProfit = totalProfits- expenses;
- System.out.printf("%.2f", finalProfit);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement