Advertisement
AnastasiyaG

Untitled

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