Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace Conditional_Statements_Advanced___More_Exercises
- {
- class Program
- {
- static void Main(string[] args)
- {
- double vip = 499.99;
- double normal = 249.99;
- double budget = double.Parse(Console.ReadLine());
- string category = Console.ReadLine();
- double people = double.Parse(Console.ReadLine());
- double transportniRazhodi = 0;
- if (people >= 1 && people <= 4)
- {
- transportniRazhodi = budget * 75 / 100;
- if (category == "Normal")
- {
- double ticketCost = normal * people;
- }
- else
- {
- double ticketCost = vip * people;
- }
- }
- else if (people >= 5 && people <= 9)
- {
- transportniRazhodi = budget * 60 / 100;
- if (category == "Normal")
- {
- double ticketCost = normal * people;
- }
- else
- {
- double ticketCost = vip * people;
- }
- }
- else if (people >= 10 && people <= 24)
- {
- transportniRazhodi = budget * 50 / 100;
- if (category == "Normal")
- {
- double ticketCost = normal * people;
- }
- else
- {
- double ticketCost = vip * people;
- }
- }
- else if (people >= 25 && people <= 49)
- {
- transportniRazhodi = budget * 40 / 100;
- if (category == "Normal")
- {
- double ticketCost = normal * people;
- }
- else
- {
- double ticketCost = vip * people;
- }
- }
- else if (people >= 50)
- {
- transportniRazhodi = budget * 25 / 100;
- if (category == "Normal")
- {
- double ticketCost = normal * people;
- }
- else
- {
- double ticketCost = vip * people;
- }
- }
- double moneyLeft = budget - transportniRazhodi;
- if (ticketCost < moneyLeft)
- {
- Console.WriteLine($"Yes! You have {moneyLeft - ticketCost:f2} leva left.");
- }
- else
- {
- Console.WriteLine($"Not enough money! You need {ticketCost - transportniRazhodi} leva.");
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement