Guest User

Bike race

a guest
Mar 11th, 2017
361
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.23 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 Problem_03.Bike_Race
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var JuniorCyclists = double.Parse(Console.ReadLine());
  14. var SeniorCyclists = double.Parse(Console.ReadLine());
  15. string traceType = Console.ReadLine();
  16. var juniorsTaksa = 0.00;
  17. var seniorsTaaksa = 0.00;
  18. var gatheredMoney = 0.00;
  19. var razhodi = gatheredMoney - (5.00/100.00*gatheredMoney);
  20. var totalEverything = 0.00;
  21. var allParticipants = JuniorCyclists + SeniorCyclists;
  22. switch (traceType)
  23. {
  24. case "trail":
  25. juniorsTaksa += 5.50;
  26. seniorsTaaksa += 7.00;
  27. break;
  28. case ("cross-country"):
  29. juniorsTaksa += 8.00;
  30. seniorsTaaksa += 9.50;
  31. break;
  32. case ("downhill"):
  33. juniorsTaksa += 12.25;
  34. seniorsTaaksa += 13.75;
  35. break;
  36. case ("road"):
  37. juniorsTaksa += 20.00;
  38. seniorsTaaksa += 21.50;
  39. break;
  40. }
  41.  
  42. if (traceType == "cross-country")
  43. {
  44. gatheredMoney = ((JuniorCyclists * juniorsTaksa) +( SeniorCyclists * seniorsTaaksa));
  45. razhodi = (5.00 / 100.00 * gatheredMoney);
  46. totalEverything = gatheredMoney - razhodi;
  47. }
  48. if (traceType == "trail" || traceType =="downhill" || traceType == "road")
  49. {
  50. gatheredMoney = ((JuniorCyclists * juniorsTaksa) + (SeniorCyclists * seniorsTaaksa));
  51. razhodi = (5.00 / 100.00 * gatheredMoney);
  52. totalEverything = gatheredMoney - razhodi;
  53. }
  54. if (allParticipants >= 50.00)
  55. {
  56. totalEverything = (totalEverything - (25.00/100.00*totalEverything));
  57. }
  58. Console.WriteLine("{0:f2}" ,totalEverything);
  59. }
  60. }
  61. }
Advertisement
Add Comment
Please, Sign In to add comment