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 Match_Tickets
- {
- class Program
- {
- static void Main(string[] args)
- {
- decimal budget = decimal.Parse(Console.ReadLine());
- string ticketType = Console.ReadLine();
- int peopleCount = int.Parse(Console.ReadLine());
- decimal transportCharges = 0.00M;
- decimal moneyForTickets = 0.00M;
- decimal difference = 0.00M;
- if (peopleCount <= 4)
- {
- transportCharges = 0.75M * budget;
- }
- else if (peopleCount <= 9)
- {
- transportCharges = 0.60M * budget;
- }
- else if (peopleCount <= 24)
- {
- transportCharges = 0.50M * budget;
- }
- else if (peopleCount <= 49)
- {
- transportCharges = 0.40M * budget;
- }
- else if (peopleCount >= 50)
- {
- transportCharges = 0.25M * budget;
- }
- switch (ticketType)
- {
- case "Normal":
- moneyForTickets = peopleCount * 249.99M;
- break;
- case "VIP":
- moneyForTickets = peopleCount * 499.99M;
- break;
- default:
- moneyForTickets = peopleCount * 249.99M;
- break;
- }
- difference = budget - moneyForTickets - transportCharges;
- string result = string.Format("Yes! You have {0} leva left.", decimal.Round(difference,2));
- if (difference < 0)
- {
- result = string.Format("Not enough money! You need {0:F2} leva.",
- Math.Abs(decimal.Round(difference, 2)));
- }
- Console.WriteLine(result);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment