Krasimir_Slavov

Untitled

Nov 15th, 2018
148
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Exam_Bachelor_Party
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. double money = double.Parse(Console.ReadLine());
  14. int people = int.Parse(Console.ReadLine());
  15.  
  16. string command = Console.ReadLine();
  17. double couvert = 0;
  18. double sum = 0;
  19. int guests = 0;
  20.  
  21. while ((command = Console.ReadLine()) != "The restaurant is full")
  22. {
  23. if (people < 5)
  24. {
  25. couvert = 100;
  26. guests += people;
  27. }
  28. else
  29. {
  30. couvert = 70;
  31. guests += people;
  32. }
  33. sum += couvert * people;
  34. if (sum > money)
  35. {
  36. Console.WriteLine($"You have {guests} guests and {sum - money} leva left.");
  37. }
  38. else if (sum < money)
  39. {
  40. Console.WriteLine($"You have {guests} guests and {money - sum} leva income, but no singer.");
  41. }
  42. }
  43. }
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment