Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Greeting {
- 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());
- int cakesPrice = cakes * 45;
- double wafflesPrice = waffles * 5.80;
- double pancakesPrice = pancakes * 3.20;
- double priceForDay = (cakesPrice + wafflesPrice + pancakesPrice) * bakers;
- double campaignSum = priceForDay * days;
- double finalSum = campaignSum * 0.875;
- System.out.printf("%.2f",finalSum);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement