fbinnzhivko

ProspectInHospitality 03

Apr 22nd, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.60 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. class ProspectInHospitality
  5. {
  6.     static void Main()
  7.     {
  8.         uint buildersNeeded = uint.Parse(Console.ReadLine());
  9.         uint receptNeeded = uint.Parse(Console.ReadLine());
  10.         uint chambNeeded = uint.Parse(Console.ReadLine());
  11.         uint techniciansNeeded = uint.Parse(Console.ReadLine());
  12.         uint othersNeeded = uint.Parse(Console.ReadLine());
  13.         decimal nikisSalary = decimal.Parse(Console.ReadLine());
  14.         decimal currensyUSA = decimal.Parse(Console.ReadLine());
  15.         decimal mySalary = decimal.Parse(Console.ReadLine());
  16.         decimal budget = decimal.Parse(Console.ReadLine());
  17.  
  18.         decimal buildersSalary = buildersNeeded * (decimal)1500.04;
  19.         decimal receptSalary = receptNeeded * (decimal)2102.10;
  20.         decimal chambSalary = chambNeeded * (decimal)1465.46;
  21.         decimal techniciansSalary = techniciansNeeded * (decimal)2053.33;
  22.         decimal othersSalary = othersNeeded * (decimal)3010.98;
  23.         decimal nikisLv = nikisSalary * currensyUSA;
  24.         decimal amount = buildersSalary + receptSalary + chambSalary + techniciansSalary + othersSalary + nikisLv + mySalary;
  25.  
  26.         if (amount <= budget)
  27.         {
  28.             decimal left = budget - amount;
  29.             Console.WriteLine("The amount is: {0:F2} lv.", amount);
  30.             Console.WriteLine(@"YES \ Left: {0:F2} lv.", left);
  31.         }
  32.         else
  33.         {
  34.             decimal need = Math.Abs(budget - amount);
  35.             Console.WriteLine("The amount is: {0:F2} lv.", amount);
  36.             Console.WriteLine(@"NO \ Need more: {0:F2} lv.", need);
  37.         }
  38.     }
  39. }
Add Comment
Please, Sign In to add comment