Advertisement
kzborisov

CharityCampaogn

Sep 11th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. using System;
  2.  
  3. namespace charityCampaign
  4. {
  5. class Program
  6. {
  7. static void Main (string[] args)
  8. {
  9. int days = int.Parse(Console.ReadLine());
  10. int bakers = int.Parse(Console.ReadLine());
  11. int cakes = int.Parse(Console.ReadLine());
  12. int waffles = int.Parse(Console.ReadLine());
  13. int pancakes = int.Parse(Console.ReadLine());
  14.  
  15. double cakesIncome = cakes * 45;
  16. double wafflesIncome = waffles * 5.80;
  17. double pancakesIncome = pancakes * 3.20;
  18.  
  19. double incomeForOneDay = (cakesIncome + wafflesIncome + pancakesIncome) * bakers;
  20. double income = incomeForOneDay * days;
  21. double expenses = income * 1 / 8;
  22. double result = income - expenses;
  23.  
  24. Console.WriteLine($"{result:F2}");
  25. }
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement