Advertisement
aneliabogeva

Untitled

Apr 5th, 2019
115
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.  
  3. namespace PasswordGenerator
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. double moneForArtist = double.Parse(Console.ReadLine());
  10. string numberOfPeople = Console.ReadLine();
  11. double price = 0;
  12. double totalNumberOfPeople = 0;
  13.  
  14. while (numberOfPeople != "The restaurant is full")
  15. {
  16. double currentPrice = 0;
  17. if ((int.Parse(numberOfPeople) < 5))
  18. {
  19. currentPrice = double.Parse(numberOfPeople) * 100;
  20. }
  21. else
  22. {
  23. currentPrice = double.Parse(numberOfPeople) * 70;
  24. }
  25.  
  26. price += currentPrice;
  27. totalNumberOfPeople += double.Parse(numberOfPeople);
  28. numberOfPeople = Console.ReadLine();
  29. }
  30.  
  31. if (price >= moneForArtist)
  32. {
  33. Console.WriteLine($"You have {totalNumberOfPeople} guests and {price - moneForArtist} leva left.");
  34. }
  35. else
  36. {
  37. Console.WriteLine($"You have {totalNumberOfPeople} guests and {price} leva income, but no singer.");
  38. }
  39.  
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement