Advertisement
silvi81

Dream Item

Nov 14th, 2015
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.37 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace DreamItem
  8. {
  9. class DreamItem
  10. {
  11. static void Main()
  12. {
  13. string[] input = Console.ReadLine().Split('\\');
  14. decimal workingDays=0;
  15. if (input[0]== "Feb")
  16. {
  17. workingDays = 18;
  18. }
  19. if (input[0] == "Jan"|| input[0] == "March" ||input[0] == "May" || input[0] == "July" || input[0] == "Aug" || input[0] == "Oct" || input[0] == "Dec")
  20. {
  21. workingDays = 21;
  22. }
  23. if (input[0] == "Apr" || input[0] == "June"|| input[0] == "Sept" || input[0] == "Nov")
  24. {
  25. workingDays = 20;
  26. }
  27. decimal salary = workingDays * Convert.ToDecimal(input[1]) * Convert.ToDecimal(input[2]);
  28. if (salary>700)
  29. {
  30. salary +=salary/10;
  31. }
  32. //Console.WriteLine(salary);
  33. decimal price = Convert.ToDecimal(input[3]);
  34. if (salary>= price)
  35. {
  36. Console.WriteLine("Money left = {0:0.00} leva.",salary-price);
  37. }
  38. else
  39. {
  40. Console.WriteLine("Not enough money. {0:0.00} leva needed.",price-salary);
  41. }
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement