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