Advertisement
desislava_topuzakova

Untitled

Dec 4th, 2022
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.46 KB | None | 0 0
  1. using System;
  2.  
  3. namespace _31.3zadacha
  4. {
  5. internal class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int nights = int.Parse(Console.ReadLine());
  10. string destination = Console.ReadLine();
  11. string roomType = Console.ReadLine();
  12. double price = 0;
  13.  
  14. switch (destination)
  15. {
  16. case "Colorado":
  17. if (roomType == "double room")
  18. {
  19. price = 38;
  20. }
  21. else if (roomType == "apartment")
  22. {
  23. price = 45;
  24. }
  25. break;
  26. case "Alps":
  27. if (roomType == "double room")
  28. {
  29. price = 35;
  30. }
  31. else if (roomType == "apartment")
  32. {
  33. price = 42;
  34. }
  35. break;
  36. case "Andie":
  37. if (roomType == "double room")
  38. {
  39. price = 39;
  40. }
  41. else if (roomType == "apartment")
  42. {
  43. price = 49;
  44. }
  45. break;
  46. }
  47.  
  48. Console.WriteLine($"They have to spend {(nights * price):F2} leva.");
  49. }
  50. }
  51. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement