fbinnzhivko

Prospect In Hospitality 2c

Mar 10th, 2016
112
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.  
  3. internal class Problem01ProspectInHospitality
  4. {
  5.     private static void Main()
  6.     {
  7.         decimal buildersSalary = 1500.04m;
  8.         decimal receptionistsSalary = 2102.10m;
  9.         decimal chambermaidsSalary = 1465.46m;
  10.         decimal techniciansSalary = 2053.33m;
  11.         decimal othersSalary = 3010.98m;
  12.  
  13.  
  14.         uint b = uint.Parse(Console.ReadLine());
  15.         buildersSalary *= b;
  16.  
  17.         uint r = uint.Parse(Console.ReadLine());
  18.         receptionistsSalary *= r;
  19.  
  20.         uint c = uint.Parse(Console.ReadLine());
  21.         chambermaidsSalary *= c;
  22.  
  23.         uint t = uint.Parse(Console.ReadLine());
  24.         techniciansSalary *= t;
  25.  
  26.         uint o = uint.Parse(Console.ReadLine());
  27.         othersSalary *= o;
  28.  
  29.         decimal n = decimal.Parse(Console.ReadLine());
  30.         decimal nSalary = decimal.Parse(Console.ReadLine());
  31.         nSalary *= n;
  32.  
  33.         decimal s = decimal.Parse(Console.ReadLine());
  34.         decimal m = decimal.Parse(Console.ReadLine());
  35.  
  36.         decimal totalExpences =
  37.             buildersSalary + receptionistsSalary +
  38.             chambermaidsSalary + techniciansSalary +
  39.             othersSalary + nSalary + s;
  40.  
  41.         Console.WriteLine("The amount is: {0:f2} lv.", totalExpences);
  42.         Console.WriteLine("{0} \\ {1}: {2:f2} lv.",totalExpences <= m ? "YES" : "NO",totalExpences <= m ? "Left" : "Need more",
  43.             Math.Abs(m - totalExpences));
  44.  
  45.     }
  46. }
Add Comment
Please, Sign In to add comment