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 BikeRace
- {
- class Program
- {
- static void Main(string[] args)
- {
- int juniorRacers = int.Parse(Console.ReadLine());
- int seniorRacers = int.Parse(Console.ReadLine());
- string traceType = Console.ReadLine().ToLower();
- double juniorTicketPrice = 5.5;
- double seniorTicketPrice = 7.0;
- if (traceType == "cross-country")
- {
- //special case1
- juniorTicketPrice = 8.0;
- seniorTicketPrice = 9.5;
- int totalPeopleCount = juniorRacers + seniorRacers;
- if (totalPeopleCount >= 50)
- {
- juniorTicketPrice *= 0.75;
- seniorTicketPrice *= 0.75;
- }
- }
- else if (traceType == "downhill")
- {
- juniorTicketPrice = 12.25;
- seniorTicketPrice = 13.75;
- }
- else if (traceType == "road")
- {
- juniorTicketPrice = 20.0;
- seniorTicketPrice = 21.5;
- }
- double totalMoneyEarned = (juniorRacers * juniorTicketPrice) +
- (seniorRacers * seniorTicketPrice);
- double finalMoneyResult = totalMoneyEarned * 0.95;
- Console.WriteLine($"{finalMoneyResult:f2}");
- }
- }
- }
Add Comment
Please, Sign In to add comment