Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Conditional_Statements_Advanced___More_Exercises
- {
- class Program
- {
- static void Main(string[] args)
- {
- double juniors = double.Parse(Console.ReadLine());
- double seniors = double.Parse(Console.ReadLine());
- string trace = Console.ReadLine();
- double sum = 0;
- if (trace == "trail")
- {
- sum = juniors * 5.5 + seniors * 7;
- }
- if (trace == "cross-country")
- {
- sum = juniors * 8 + seniors * 9.50;
- }
- if (trace == "downhill")
- {
- sum = juniors * 12.25 + seniors * 13.75;
- }
- if (trace == "road")
- {
- sum = juniors * 20 + seniors * 21.50;
- }
- double costs = (5 * sum) / 100;
- double f = sum - costs;
- Console.WriteLine($"{Math.Abs(f):f2}");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement