desislava777

Bonus Score

Oct 21st, 2017
603
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Diagnostics;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. using System.Numerics;
  8.  
  9. namespace ConsoleApplication28
  10. {
  11. class Program
  12. {
  13. static void Main(string[] args)
  14. {
  15. var num = int.Parse(Console.ReadLine());
  16. double bonusScore = 0;
  17. if (num <= 100)
  18. {
  19. bonusScore = 5;
  20. }
  21. else if (num > 100&&num<=1000)
  22. {
  23. bonusScore = num * 0.20;
  24. }
  25. else if (num > 1000)
  26. {
  27. bonusScore = num * 0.10;
  28. }
  29. if (num % 2 == 0)
  30. {
  31. bonusScore += 1;
  32. }
  33. else if (num % 10 == 5)
  34. {
  35. bonusScore += 2;
  36. }
  37. Console.WriteLine("Bonus score: {0}", bonusScore);
  38. Console.WriteLine("Total score: {0}", num + bonusScore);
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment