Advertisement
Guest User

Untitled

a guest
Nov 23rd, 2017
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. using System;
  2. using System.Globalization;
  3.  
  4. namespace CSharp
  5. {
  6. class MainClass
  7. {
  8. public static void Main (string[] args)
  9. {
  10.  
  11. string month = Console.ReadLine ();
  12. var numNights = double.Parse (Console.ReadLine ());
  13. double priceStudio = 0;
  14. double priceDoubleNight = 0;
  15. double priceSuite = 0;
  16.  
  17. if (month=="May"||month=="October") {
  18.  
  19. priceStudio = numNights * 50;
  20. priceDoubleNight = numNights * 65;
  21. priceSuite = numNights * 75;
  22.  
  23.  
  24.  
  25. }
  26. else if (month=="June"||month=="September") {
  27.  
  28. priceStudio = numNights * 60;
  29. priceDoubleNight = numNights * 72;
  30. priceSuite = numNights * 82;
  31.  
  32.  
  33.  
  34. }
  35. else if (month=="July"||month=="August"||month=="December") {
  36.  
  37. priceStudio = numNights * 68;
  38. priceDoubleNight = numNights * 77;
  39. priceSuite = numNights * 89;
  40.  
  41.  
  42.  
  43. }
  44. if ((month=="May"|| month=="October")&&numNights>7) {
  45. priceStudio = priceStudio - priceStudio*0.05;
  46.  
  47.  
  48. }
  49. else if ((month=="June"|| month=="September")&&numNights>14) {
  50. priceDoubleNight = priceDoubleNight - priceDoubleNight*0.1;
  51. }
  52. else if ((month=="July"||month=="August"||month=="December")&&numNights>14) {
  53. priceSuite = priceSuite - priceSuite*0.15;
  54.  
  55. }
  56. else if ((month=="September"||month=="October")&&numNights>7) {
  57. priceStudio = priceStudio - (priceStudio/numNights);
  58. }
  59.  
  60. Console.WriteLine ("Studio: {0:0.00} lv.",priceStudio);
  61. Console.WriteLine ("Double: {0:0.00} lv.",priceDoubleNight);
  62. Console.WriteLine ("Suite: {0:0.00} lv.",priceSuite);
  63.  
  64.  
  65.  
  66. }
  67.  
  68. }}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement