Advertisement
Guest User

Untitled

a guest
Jul 20th, 2016
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.34 KB | None | 0 0
  1. using System;
  2.  
  3. class Program
  4. {
  5.     public static void Main ()
  6.     {
  7.         decimal NormalPrice = 249.99m;
  8.         decimal VIPPrice = 499.99m;
  9.  
  10.         decimal budget = decimal.Parse (Console.ReadLine ());
  11.         string category = Console.ReadLine ();
  12.         int people = int.Parse (Console.ReadLine ());
  13.  
  14.         decimal result = 0.0m;
  15.  
  16.         if (people >= 1 && people <= 4)
  17.         {
  18.             result = budget - (75 * budget) / 100;
  19.         }
  20.         else if (people >= 5 && people <= 9)
  21.         {
  22.             result = budget - (60 * budget) / 100;
  23.         }
  24.         else if (people >= 10 && people <= 24)
  25.         {
  26.             result = budget - (50 * budget) / 100;
  27.         }
  28.         else if (people >= 25 && people <= 49)
  29.         {
  30.             result = budget - (40 * budget) / 100;
  31.         }
  32.         else if (people >= 50)
  33.         {
  34.             result = budget - (25 * budget) / 100;
  35.         }
  36.  
  37.         if (category == "Normal")
  38.         {
  39.             if (result > people * NormalPrice)
  40.             {
  41.                 Console.WriteLine ("Yes! You have {0:F2} leva left.", result - (people * NormalPrice));
  42.             }
  43.             else
  44.             {
  45.                 Console.WriteLine ("Not enough money! You need {0:F2} leva.", (people * NormalPrice) - result);
  46.             }
  47.         }
  48.         else if (category == "VIP")
  49.         {
  50.             if (result > people * VIPPrice)
  51.             {
  52.                 Console.WriteLine ("Yes! You have {0:F2} leva left.", result - (people * VIPPrice));
  53.             }
  54.             else
  55.             {
  56.                 Console.WriteLine ("Not enough money! You need {0:F2} leva.", (people * VIPPrice) - result);
  57.             }
  58.         }
  59.     }
  60. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement