Advertisement
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 MatchTickets
- {
- class Program
- {
- static void Main(string[] args)
- {
- var budget = double.Parse(Console.ReadLine());
- string category = Console.ReadLine();
- var people = int.Parse(Console.ReadLine());
- var price = 0.0;
- if (category=="VIP")
- {
- price = 499.99*people;
- }
- else
- {
- price = 249.99*people;
- }
- var trancentBudget = 0.0;
- if ((people>=1)&&(people<=4))
- {
- trancentBudget = budget - budget * 0.75;
- }
- else if ((people >= 5) && (people <= 9))
- {
- trancentBudget = budget - budget * 0.60;
- }
- else if ((people >= 10) && (people <= 24))
- {
- trancentBudget = budget - budget * 0.50;
- }
- else if ((people >= 25) && (people <= 49))
- {
- trancentBudget = budget - budget * 0.40;
- }
- else if (people >= 55)
- {
- trancentBudget = budget - budget * 0.25;
- }
- if (price <= trancentBudget)
- {
- Console.WriteLine($"Yes! You have {(trancentBudget-price):f2} leva left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! You need {(price - trancentBudget):f2} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement