Advertisement
Spocoman

Charity Campaign

Sep 3rd, 2024
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.61 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main {
  4.     public static void main(String[] args) {
  5.         Scanner scanner = new Scanner(System.in);
  6.         int days = Integer.parseInt(scanner.nextLine()),
  7.                 cookers = Integer.parseInt(scanner.nextLine()),
  8.                 cakes = Integer.parseInt(scanner.nextLine()),
  9.                 waffles = Integer.parseInt(scanner.nextLine()),
  10.                 pancakes = Integer.parseInt(scanner.nextLine());
  11.  
  12.         double sum = days * cookers * ((cakes * 45.00) + (waffles * 5.80) + (pancakes * 3.20));
  13.         System.out.printf("%.2f\n", sum - sum / 8);
  14.     }
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement