Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace FitnessCard
- {
- class Program
- {
- static void Main(string[] args)
- {
- double cash = double.Parse(Console.ReadLine());
- string sex = Console.ReadLine();
- int age = int.Parse(Console.ReadLine());
- string sport = Console.ReadLine();
- double sum = 0;
- if (sex == "m")
- {
- switch (sport)
- {
- case "Gym":
- sum = 42;
- break;
- case "Boxing":
- sum = 41;
- break;
- case "Yoga":
- sum = 45;
- break;
- case "Zumba":
- sum = 34;
- break;
- case "Dances":
- sum = 51;
- break;
- case "Pilates":
- sum = 39;
- break;
- }
- }
- else if (sex == "f")
- {
- switch (sport)
- {
- case "Gym":
- sum = 35;
- break;
- case "Boxing":
- sum = 37;
- break;
- case "Yoga":
- sum = 42;
- break;
- case "Zumba":
- sum = 31;
- break;
- case "Dances":
- sum = 53;
- break;
- case "Pilates":
- sum = 37;
- break;
- }
- }
- if (age <= 19)
- {
- sum *= 0.8;
- }
- if (sum <= cash)
- {
- Console.WriteLine($"You purchased a 1 month pass for {sport}.");
- }
- else
- {
- Console.WriteLine($"You don't have enough money! You need ${sum - cash:F2} more.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement