wingman007

BasicsExamProspectInHospitality

Dec 12th, 2015
405
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.43 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. class ProspectInHospitality
  5. {
  6.     static void Main()
  7.     {
  8.         // input
  9.         uint builders = uint.Parse(Console.ReadLine()); // 0; // 20; //
  10.         uint receptionists = uint.Parse(Console.ReadLine()); //20; // 10; //
  11.         uint chambermaids = uint.Parse(Console.ReadLine()); // 50; // 8; //
  12.         uint technicians = uint.Parse(Console.ReadLine()); // 0; // 2; //
  13.         uint other = uint.Parse(Console.ReadLine()); // 100; // 4; //
  14.         decimal niki = decimal.Parse(Console.ReadLine()); // 1000.5M; // 3000.06M; //
  15.         decimal exchangeRate = decimal.Parse(Console.ReadLine()); // 1.89M; // 1.08; // 0.87M; //
  16.         decimal salary = decimal.Parse(Console.ReadLine()); // 100000.698M; // 30000.0001M; //
  17.         decimal mBudget =  decimal.Parse(Console.ReadLine()); // 100000.691M; // 2000000.003M; //
  18.  
  19.         decimal result = builders * 1500.04M +
  20.             receptionists * 2102.10M +
  21.             chambermaids * 1465.46M +
  22.             technicians * 2053.33M +
  23.             other * 3010.98M +
  24.             niki * exchangeRate +
  25.             salary;
  26.  
  27.         // output
  28.         Console.WriteLine("The amount is: {0:F2} lv.", result);
  29.         if (result <= mBudget)
  30.         {
  31.             Console.WriteLine("YES \\ Left: {0:F2} lv.", mBudget - result);
  32.         }
  33.         else
  34.         {
  35.             Console.WriteLine("NO \\ Need more: {0:F2} lv.", result - mBudget);
  36.         }
  37.     }
  38. }
Advertisement
Add Comment
Please, Sign In to add comment