Advertisement
AJMitev

BonusPoints

Jan 22nd, 2017
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. using System;
  2.  
  3. namespace BonusPoints
  4. {
  5. class BonusPoints
  6. {
  7. static void Main()
  8. {
  9. try
  10. {
  11. int points = int.Parse(Console.ReadLine());
  12. double bonus = 0;
  13. if (points <= 100)
  14. {
  15. bonus = 5;
  16. }
  17. else if (points >= 101 && points <= 999)
  18. {
  19. bonus = (points * 0.2);
  20. }
  21. else if (points >= 1000)
  22. {
  23. bonus = (points * 0.10);
  24. } if (points % 2 == 0)
  25. {
  26. bonus = bonus + 1;
  27. }
  28. else if (points % 5 == 0)
  29. {
  30. bonus = bonus + 2;
  31. }
  32. Console.WriteLine(bonus);
  33. Console.WriteLine(points + bonus);
  34.  
  35. }
  36. catch (Exception)
  37. {
  38. Console.WriteLine("Integer numbers only!");
  39. }
  40. }
  41. }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement