Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- class Program
- {
- public static void Main ()
- {
- decimal NormalPrice = 249.99m;
- decimal VIPPrice = 499.99m;
- decimal budget = decimal.Parse (Console.ReadLine ());
- string category = Console.ReadLine ();
- int people = int.Parse (Console.ReadLine ());
- decimal result = 0.0m;
- if (people >= 1 && people <= 4)
- {
- result = budget - (75 * budget) / 100;
- }
- else if (people >= 5 && people <= 9)
- {
- result = budget - (60 * budget) / 100;
- }
- else if (people >= 10 && people <= 24)
- {
- result = budget - (50 * budget) / 100;
- }
- else if (people >= 25 && people <= 49)
- {
- result = budget - (40 * budget) / 100;
- }
- else if (people >= 50)
- {
- result = budget - (25 * budget) / 100;
- }
- if (category == "Normal")
- {
- if (result > people * NormalPrice)
- {
- Console.WriteLine ("Yes! You have {0:F2} leva left.", result - (people * NormalPrice));
- }
- else
- {
- Console.WriteLine ("Not enough money! You need {0:F2} leva.", (people * NormalPrice) - result);
- }
- }
- else if (category == "VIP")
- {
- if (result > people * VIPPrice)
- {
- Console.WriteLine ("Yes! You have {0:F2} leva left.", result - (people * VIPPrice));
- }
- else
- {
- Console.WriteLine ("Not enough money! You need {0:F2} leva.", (people * VIPPrice) - result);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement