Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class Charity {
- public static void main(String[] args) {
- Scanner scanner = new Scanner(System.in);
- int DaysForCharity = Integer.parseInt(scanner.nextLine());
- int PastryChefs = Integer.parseInt(scanner.nextLine());
- int Cakes = Integer.parseInt(scanner.nextLine());
- int Waffles = Integer.parseInt(scanner.nextLine());
- int Pancakes = Integer.parseInt(scanner.nextLine());
- int CakeProfit = Cakes * 45 ;
- double WafflesProfit = Waffles * 5.80;
- double PancakesProfit = Pancakes * 3.20;
- double ProfitPerDay = (CakeProfit + WafflesProfit + PancakesProfit)* PastryChefs;
- double CampaingSum = ProfitPerDay * DaysForCharity ;
- double FinalProfit = CampaingSum - 1.0/8 * CampaingSum;
- System.out.printf("%.2f", FinalProfit);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement