Advertisement
Guest User

Untitled

a guest
Mar 18th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Charity {
  4. public static void main(String[] args) {
  5. Scanner scanner = new Scanner(System.in);
  6. int DaysForCharity = Integer.parseInt(scanner.nextLine());
  7. int PastryChefs = Integer.parseInt(scanner.nextLine());
  8. int Cakes = Integer.parseInt(scanner.nextLine());
  9. int Waffles = Integer.parseInt(scanner.nextLine());
  10. int Pancakes = Integer.parseInt(scanner.nextLine());
  11. int CakeProfit = Cakes * 45 ;
  12. double WafflesProfit = Waffles * 5.80;
  13. double PancakesProfit = Pancakes * 3.20;
  14. double ProfitPerDay = (CakeProfit + WafflesProfit + PancakesProfit)* PastryChefs;
  15. double CampaingSum = ProfitPerDay * DaysForCharity ;
  16. double FinalProfit = CampaingSum - 1.0/8 * CampaingSum;
  17. System.out.printf("%.2f", FinalProfit);
  18. }
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement