Advertisement
social1986

Untitled

Jun 22nd, 2017
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 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 Bike_Race
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. int juniors = int.Parse(Console.ReadLine());
  14. int seniors = int.Parse(Console.ReadLine());
  15. string trace = Console.ReadLine();
  16. double seniorProfit = 0;
  17. double juniorProfit = 0;
  18. int totalRacers = juniors + seniors;
  19. double totalProfit = 0;
  20.  
  21.  
  22. if (trace == "trail")
  23. {
  24. juniorProfit = juniors * 5.50;
  25. seniorProfit = seniors * 7;
  26. }
  27. else if (trace == "cross-country")
  28. {
  29. if (totalRacers >= 50)
  30. {
  31. juniorProfit = (juniors * 8) - juniors * 8 * 0.25;
  32. seniorProfit = (seniors * 9.50) - seniors * 9.50 * 0.25;
  33. }
  34. else
  35. {
  36. juniorProfit = juniors * 8;
  37. seniorProfit = seniors * 9.50;
  38. }
  39. }
  40. else if (trace == "downhill")
  41. {
  42. juniorProfit = juniors * 12.25;
  43. seniorProfit = seniors * 13.75;
  44. }
  45. else if (trace == "road")
  46. {
  47. juniorProfit = juniors * 20;
  48. seniorProfit = seniors * 21.50;
  49. }
  50.  
  51. totalProfit = (juniorProfit + seniorProfit) - ((juniorProfit + seniorProfit) * 0.05);
  52. Console.WriteLine($"{totalProfit:f2}");
  53.  
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement