Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TicketsEuro2016
- {
- class TicketsEuro2016
- {
- static void Main(string[] args)
- {
- double money = double.Parse(Console.ReadLine());
- var categ = Console.ReadLine().ToLower();
- int people = int.Parse(Console.ReadLine());
- var sumTransport = 0.0;
- if (people >= 50) sumTransport = (double)money * 0.75;
- else if (people >= 25 && people < 50) sumTransport = (double)money * 0.60;
- else if (people >= 10 && people < 25) sumTransport = (double)money * 0.50;
- else if (people >= 5 && people < 10) sumTransport = (double)money * 0.40;
- else if (people >= 1 && people < 5) sumTransport = (double)money * 0.25;
- var sumForTickets = 0.0;
- if (categ == "vip") sumForTickets = people * 499.99;
- else if (categ == "normal") sumForTickets = people * 249.99;
- var sum = sumTransport - sumForTickets;
- if (sum > 0) Console.WriteLine("Yes! You have {0:f2} leva left.", sum);
- else Console.WriteLine("Not enough money! You need {0:f2} leva.", Math.Abs(sum));
- }
- }
- }
Add Comment
Please, Sign In to add comment