svetlyoek

Untitled

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