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 _3
- {
- class Program
- {
- static void Main()
- {
- var youngBiker = double.Parse(Console.ReadLine());
- var oldBiker = double.Parse(Console.ReadLine());
- var typeTransport = Console.ReadLine();
- var total = 0.00;
- if (typeTransport == "trail")
- {
- total += (youngBiker * 5.50 + oldBiker * 7) * 0.95;
- }
- else if (typeTransport == "cross-country")
- {
- if (youngBiker + oldBiker >= 50)
- {
- total += (youngBiker*8 + oldBiker*9.50)*0.75*0.95;
- }
- else
- {
- total += (youngBiker * 8 + oldBiker * 9.50) * 0.95;
- }
- }
- else if (typeTransport == "road")
- {
- total += (youngBiker * 20 + oldBiker * 21.50) * 0.95;
- }
- else if (typeTransport == "downhill")
- {
- total += (youngBiker * 12.25 + oldBiker * 13.75) * 0.95;
- }
- Console.WriteLine("{0:f2}", total);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement