Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.net.SocketOption;
- import java.util.Scanner;
- import static java.lang.Math.PI;
- 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 goffrets = Integer.parseInt(scanner.nextLine());
- int pancakes = Integer.parseInt(scanner.nextLine());
- double cakesProfit = 45 * cakes;
- double goffretsProfit = 5.80 * goffrets;
- double pancakesProfit = 3.20 * pancakes;
- double sumPerDay = (cakesProfit + goffretsProfit + pancakesProfit);
- double totalSum = sumPerDay * days;
- double expenses = totalSum * 1/8;
- double finalSum = totalSum - expenses;
- System.out.printf("%.2f", finalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement