svetlyoek

Untitled

Jan 24th, 2019
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp133
  4. {
  5. class Program
  6. {
  7. static void Main(string[] args)
  8. {
  9. int people = int.Parse(Console.ReadLine());
  10. string peopleType = Console.ReadLine();
  11. string dayType = Console.ReadLine();
  12. double price = 0;
  13. double discount = 0;
  14.  
  15. if (dayType == "Friday")
  16. {
  17. if (peopleType == "Students")
  18. {
  19. price = 8.45;
  20. }
  21. else if (peopleType == "Business")
  22. {
  23. price = 10.90;
  24. }
  25. else if (peopleType == "Regular")
  26. {
  27. price = 15.00;
  28. }
  29. }
  30. else if (dayType == "Saturday")
  31. {
  32. if (peopleType == "Students")
  33. {
  34. price = 9.80;
  35. }
  36. else if (peopleType == "Business")
  37. {
  38. price = 15.60;
  39. }
  40. else if (peopleType == "Regular")
  41. {
  42. price = 20.00;
  43. }
  44. }
  45. else if (dayType == "Sunday")
  46. {
  47. if (peopleType == "Students")
  48. {
  49. price = 10.46;
  50. }
  51. else if (peopleType == "Business")
  52. {
  53. price = 16.00;
  54. }
  55. else if (peopleType == "Regular")
  56. {
  57. price = 22.50;
  58. }
  59. }
  60.  
  61. if (people >= 30 && peopleType == "Students")
  62. {
  63.  
  64.  
  65. discount = (people * price) * 0.15;
  66. Console.WriteLine("Total price: {0:f2}", (people*price)- discount);
  67.  
  68. }
  69. else if (peopleType == "Business" && people >= 100)
  70. {
  71.  
  72.  
  73. people -= 10;
  74. Console.WriteLine("Total price: {0:f2}", people*price);
  75. }
  76. else if (peopleType == "Regular" && people >= 10 && people <= 20)
  77. {
  78.  
  79.  
  80. discount = (people * price) * 0.05;
  81. Console.WriteLine("Total price: {0:f2}",(people*price) - discount);
  82. }
  83. else
  84. {
  85. Console.WriteLine("Total price: {0:f2}", (people * price));
  86. }
  87.  
  88.  
  89.  
  90.  
  91. }
  92. }
  93. }
Add Comment
Please, Sign In to add comment