Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class ex06CharityCampaign {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int daysCount = Integer.parseInt(scanner.nextLine());
- int cookerCount = Integer.parseInt(scanner.nextLine());
- int cakesCount = Integer.parseInt(scanner.nextLine());
- int waffles = Integer.parseInt(scanner.nextLine());
- int pancakes = Integer.parseInt(scanner.nextLine());
- int cakesPrice = cakesCount * 45;
- double wafflesPrice = waffles * 5.80;
- double pancakesPrice = pancakes * 3.20;
- double profit = (cakesPrice + wafflesPrice + pancakesPrice) * cookerCount * daysCount;
- double totalProfit = profit - profit / 8;
- System.out.printf("%.2f", totalProfit);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement