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 cakePrice = 45;
- double goffretsPrice = 5.80;
- double pancakePrice = 3.20;
- double sumPerDay = ((cakes * cakePrice) + (goffrets * goffretsPrice) + (pancakes * pancakePrice));
- double totalSum = sumPerDay * days;
- double finalSum = totalSum * 7/8;
- System.out.printf("%.2f", finalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement