Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
239
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace ConsoleApp51
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13.  
  14. string mouth = Console.ReadLine();
  15. int sleepNights = int.Parse(Console.ReadLine());
  16.  
  17. double priceStudio = 0;
  18. double priceApartment = 0;
  19.  
  20.  
  21. if (mouth == "May" || mouth == "Octomber")
  22. {
  23. priceStudio = 50;
  24. priceApartment = 65;
  25. if (sleepNights <= 7)
  26. {
  27. priceStudio = (priceStudio - 2.5) * sleepNights;
  28. }
  29. else if (sleepNights > 14)
  30. {
  31. priceStudio = (priceStudio - 15) * sleepNights;
  32. priceApartment = (priceApartment - 6.5) * sleepNights;
  33. }
  34.  
  35. Console.WriteLine($"Apartment: {priceApartment:f2} lv.");
  36. Console.WriteLine($"Studio: {priceStudio:f2} lv.");
  37.  
  38. }
  39.  
  40. else if (mouth == "June" || mouth == "September")
  41. {
  42. priceStudio = 75.20;
  43. priceApartment = 68.70;
  44. if (sleepNights > 14)
  45.  
  46.  
  47. {
  48. priceStudio = (priceStudio - 15.04) * sleepNights;
  49. priceApartment = (priceApartment - 6.87) * sleepNights;
  50. }
  51. else if (sleepNights <= 14)
  52. {
  53. priceStudio = priceStudio * sleepNights;
  54. priceApartment = priceApartment * sleepNights;
  55.  
  56. }
  57.  
  58. Console.WriteLine($"Apartment: {priceApartment:f2} lv.");
  59. Console.WriteLine($"Studio: {priceStudio:f2} lv.");
  60.  
  61. }
  62. else if (mouth == "July" || mouth == "August")
  63. {
  64. priceStudio = 76.00 * sleepNights;
  65. priceApartment = (77.00 - 7.7) * sleepNights;
  66.  
  67.  
  68.  
  69. Console.WriteLine($"Apartment: {priceApartment:f2} lv.");
  70. Console.WriteLine($"Studio: {priceStudio:f2} lv.");
  71. }
  72.  
  73. }
  74. }
  75. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement