Advertisement
nnikolov

Untitled

Mar 22nd, 2020
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.22 KB | None | 0 0
  1. amespace _05._Bachelor_Party
  2. {
  3. class Program
  4. {
  5. static void Main(string[] args)
  6. {
  7. double singer = double.Parse(Console.ReadLine());
  8. double counterGuests = 0;
  9. double moneyCounter = 0;
  10.  
  11. while (true)
  12. {
  13. string command = Console.ReadLine();
  14. if(command == "The restaurant is full")
  15. {
  16.  
  17. break;
  18. }
  19. double waveofG = double.Parse(command);
  20. counterGuests += waveofG;
  21.  
  22. if(waveofG>=5)
  23. {
  24. moneyCounter += waveofG * 70;
  25. }
  26. else
  27. {
  28. moneyCounter += waveofG * 100;
  29. }
  30.  
  31. }
  32. double moneyLEft = moneyCounter - singer;
  33. if(moneyLEft>0)
  34. {
  35. Console.WriteLine($"You have {counterGuests} guests and {moneyLEft} leva left.");
  36. }
  37. else
  38. {
  39.  
  40. Console.WriteLine($"You have {counterGuests} guests and {moneyCounter} leva income, but no singer.");
  41. }
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement