Advertisement
plamen27

Bonus score fixed

Jul 26th, 2016
371
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.16 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. Console.WriteLine("Enter score: ");
  14. var num = int.Parse(Console.ReadLine());
  15. var bonusScore = 0.0;
  16. if (num > 1000)
  17. {
  18. bonusScore = num * 0.10;
  19. }
  20. else if (num <= 100)
  21. {
  22. bonusScore = 5; /// тук имаше грешка
  23. }
  24. else if (num > 100)
  25. {
  26. bonusScore = num * 0.20;
  27. }
  28. /// else конструкцията е грешна
  29.  
  30. if (num % 10 == 5)
  31. {
  32. bonusScore += 2;
  33. }
  34. else if (num % 2 == 0)
  35. {
  36. bonusScore += 1;
  37. }
  38. /// else конструкцията е грешна
  39. Console.WriteLine("Bonus score: {0}", bonusScore);
  40. Console.WriteLine("Total score: {0}", num + bonusScore);
  41.  
  42. }
  43. }
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement