Advertisement
Guest User

Untitled

a guest
Jan 25th, 2020
276
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.03 KB | None | 0 0
  1. using System;
  2.  
  3. namespace Ski_pochivka
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9.  
  10. int days = int.Parse(Console.ReadLine());
  11. string typeOfRoom = Console.ReadLine();
  12. string feedback = Console.ReadLine();
  13.  
  14. double pricepernight = 0.0;
  15. double discount = 0.0;
  16.  
  17. if (typeOfRoom == "roomPerOnePerson")
  18. {
  19. pricepernight = 18.00;
  20. }
  21.  
  22. else if (typeOfRoom == "apartment")
  23. {
  24. pricepernight = 25.00;
  25.  
  26. if (days > 10)
  27. {
  28. discount = 0.30;
  29. }
  30. else if (days >= 10 && days <= 15)
  31. {
  32. discount = 0.35;
  33. }
  34. else if (days > 15)
  35. {
  36. discount = 0.50;
  37. }
  38.  
  39. }
  40.  
  41. else if (typeOfRoom == "president apartment")
  42. {
  43. pricepernight = 35.00;
  44.  
  45. if (days > 10)
  46. {
  47. discount = 0.10;
  48. }
  49. else if (days >= 10 && days <= 15)
  50. {
  51. discount = 0.15;
  52. }
  53. else if (days > 15)
  54. {
  55. discount = 0.20;
  56. }
  57. }
  58.  
  59. int nights = days - 1;
  60. double totalExpenses = nights * pricepernight;
  61. totalExpenses = totalExpenses - totalExpenses * discount;
  62.  
  63. Console.WriteLine(totalExpenses);
  64.  
  65.  
  66. if (feedback == "positive")
  67. {
  68. totalExpenses = totalExpenses + (totalExpenses * 0.25);
  69. }
  70. else if (feedback == "negative")
  71. {
  72. totalExpenses = totalExpenses - (totalExpenses * 0.1);
  73. }
  74.  
  75. Console.WriteLine (($"{totalExpenses:F2}"));
  76.  
  77. }
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement