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 Ex2_ChooseADtinkTwo
- {
- class Program
- {
- static void Main(string[] args)
- {
- string profession = Console.ReadLine();
- int quantity = int.Parse(Console.ReadLine());
- double sum = 0;
- switch (profession)
- {
- case "Athlete":
- sum = quantity * 0.70;
- Console.WriteLine("The {0} has to pay {1:F2}.",profession, sum);
- break;
- case "Businessman":
- case "Businesswoman":
- sum = quantity * 1.00;
- Console.WriteLine("The {0} has to pay {1:F2}.", profession, sum);
- break;
- case "SoftUni Student":
- sum = quantity * 1.70;
- Console.WriteLine("The {0} has to pay {1:F2}.", profession, sum);
- break;
- default:
- sum = quantity * 1.20;
- Console.WriteLine("The {0} has to pay {1:F2}.", profession, sum);
- break;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment