Krassy

Bonus Score

Oct 31st, 2016
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.99 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 Bonus_Score
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. var bonus = Double.Parse(Console.ReadLine());
  14.  
  15. var bonusScore = 0.0;
  16.  
  17. if (bonus <= 100)
  18. {
  19. bonusScore = 5;
  20. }
  21. else if (bonus > 100 && bonus < 999)
  22. {
  23. bonusScore = (bonus * 20) / 100;
  24. }
  25. else if (bonus > 1000)
  26. {
  27. bonusScore = (bonus * 10) / 100;
  28. }
  29.  
  30. if (bonus % 10 == 5)
  31. {
  32. bonusScore += 2;
  33. }
  34. else if (bonus % 2 == 0)
  35. {
  36. bonusScore += 1;
  37. }
  38. Console.WriteLine(bonusScore);
  39. Console.WriteLine(bonus + bonusScore);
  40. }
  41. }
  42. }
Add Comment
Please, Sign In to add comment