Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace Problem_03.Bike_Race
- {
- class Program
- {
- static void Main(string[] args)
- {
- var JuniorCyclists = double.Parse(Console.ReadLine());
- var SeniorCyclists = double.Parse(Console.ReadLine());
- string traceType = Console.ReadLine();
- var juniorsTaksa = 0.00;
- var seniorsTaaksa = 0.00;
- var gatheredMoney = 0.00;
- var razhodi = gatheredMoney - (5.00/100.00*gatheredMoney);
- var totalEverything = 0.00;
- var allParticipants = JuniorCyclists + SeniorCyclists;
- switch (traceType)
- {
- case "trail":
- juniorsTaksa += 5.50;
- seniorsTaaksa += 7.00;
- break;
- case ("cross-country"):
- juniorsTaksa += 8.00;
- seniorsTaaksa += 9.50;
- break;
- case ("downhill"):
- juniorsTaksa += 12.25;
- seniorsTaaksa += 13.75;
- break;
- case ("road"):
- juniorsTaksa += 20.00;
- seniorsTaaksa += 21.50;
- break;
- }
- if (traceType == "cross-country")
- {
- gatheredMoney = ((JuniorCyclists * juniorsTaksa) +( SeniorCyclists * seniorsTaaksa));
- razhodi = (5.00 / 100.00 * gatheredMoney);
- totalEverything = gatheredMoney - razhodi;
- }
- if (traceType == "trail" || traceType =="downhill" || traceType == "road")
- {
- gatheredMoney = ((JuniorCyclists * juniorsTaksa) + (SeniorCyclists * seniorsTaaksa));
- razhodi = (5.00 / 100.00 * gatheredMoney);
- totalEverything = gatheredMoney - razhodi;
- }
- if (allParticipants >= 50.00 && traceType == "cross-country")
- {
- totalEverything = (totalEverything - (25.00/100.00*totalEverything));
- }
- Console.WriteLine("{0:f2}" ,totalEverything);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement