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 BiletiZaMach
- {
- class Program
- {
- static void Main(string[] args)
- {
- var budjet = double.Parse(Console.ReadLine());
- var categoria = Console.ReadLine();
- var hora = int.Parse(Console.ReadLine());
- double sumaBileti = 0;
- double ostavashti = 0;
- if (hora >= 1 && hora <= 4)
- {
- switch (categoria)
- {
- case "VIP":
- sumaBileti = hora * 499.99;
- break;
- case "Normal":
- sumaBileti = hora * 249.99;
- break;
- default:
- break;
- }
- ostavashti = (budjet * 0.25 - sumaBileti);
- }
- else if (hora >= 5 && hora <= 9)
- {
- switch (categoria)
- {
- case "VIP":
- sumaBileti = hora * 499.99;
- break;
- case "Normal":
- sumaBileti = hora * 249.99;
- break;
- default:
- break;
- }
- ostavashti = (budjet * 0.40 - sumaBileti);
- }
- else if (hora >= 10 && hora <= 24)
- {
- switch (categoria)
- {
- case "VIP":
- sumaBileti = hora * 499.99;
- break;
- case "Normal":
- sumaBileti = hora * 249.99;
- break;
- default:
- break;
- }
- ostavashti = (budjet * 0.50 - sumaBileti);
- }
- else if (hora >= 25 && hora <= 49)
- {
- switch (categoria)
- {
- case "VIP":
- sumaBileti = hora * 499.99;
- break;
- case "Normal":
- sumaBileti = hora * 249.99;
- break;
- default:
- break;
- }
- ostavashti = (budjet * 0.60 - sumaBileti);
- }
- else if (hora >= 50)
- {
- switch (categoria)
- {
- case "VIP":
- sumaBileti = hora * 499.99;
- break;
- case "Normal":
- sumaBileti = hora * 249.99;
- break;
- default:
- break;
- }
- ostavashti = (budjet * 0.75 - sumaBileti);
- }
- else
- {
- }
- if (ostavashti >= 0)
- {
- Console.WriteLine("Yes! You have {0:F2} leva left.", ostavashti);
- }
- else
- {
- Console.WriteLine("Not enough money! You need {0:F2} leva.", Math.Abs(ostavashti));
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement