fbinnzhivko

Problem01ProspectInHospitality

Apr 22nd, 2016
210
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.42 KB | None | 0 0
  1. using System;
  2. internal class Problem01ProspectInHospitality
  3. {
  4.     private static void Main()
  5.     {
  6.         decimal buildersSalary = 1500.04m;
  7.         decimal receptionistsSalary = 2102.10m;
  8.         decimal chambermaidsSalary = 1465.46m;
  9.         decimal techniciansSalary = 2053.33m;
  10.         decimal othersSalary = 3010.98m;
  11.  
  12.  
  13.         uint b = uint.Parse(Console.ReadLine());
  14.         buildersSalary *= b;
  15.  
  16.         uint r = uint.Parse(Console.ReadLine());
  17.         receptionistsSalary *= r;
  18.  
  19.         uint c = uint.Parse(Console.ReadLine());
  20.         chambermaidsSalary *= c;
  21.  
  22.         uint t = uint.Parse(Console.ReadLine());
  23.         techniciansSalary *= t;
  24.  
  25.         uint o = uint.Parse(Console.ReadLine());
  26.         othersSalary *= o;
  27.  
  28.         decimal n = decimal.Parse(Console.ReadLine());
  29.         decimal nSalary = decimal.Parse(Console.ReadLine());
  30.         nSalary *= n;
  31.  
  32.         decimal s = decimal.Parse(Console.ReadLine());
  33.         decimal m = decimal.Parse(Console.ReadLine());
  34.  
  35.         decimal totalExpences =
  36.             buildersSalary + receptionistsSalary +
  37.             chambermaidsSalary + techniciansSalary +
  38.             othersSalary + nSalary + s;
  39.  
  40.         Console.WriteLine("The amount is: {0:f2} lv.", totalExpences);
  41.         Console.WriteLine("{0} \\ {1}: {2:f2} lv.", totalExpences <= m ? "YES" : "NO", totalExpences <= m ? "Left" : "Need more",
  42.             Math.Abs(m - totalExpences));
  43.  
  44.     }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment