ktopchiev

Bonus Score

Oct 24th, 2017
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.01 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.Write("Enter score: ");
  14.             int num = int.Parse(Console.ReadLine());
  15.             double bonusPoints = 0.0;
  16.             if (num <= 100)
  17.             {
  18.                 bonusPoints = 5;
  19.             }
  20.             else if (num > 100 && num < 1000)
  21.             {
  22.                 bonusPoints = num * 0.2;
  23.             }
  24.             else if (num > 1000)
  25.             {
  26.                 bonusPoints = num * 0.1;
  27.             }
  28.  
  29.             if (num % 2 == 0)
  30.             {
  31.                 bonusPoints += 1;
  32.             }
  33.             else if (num % 10 == 5)
  34.             {
  35.                 bonusPoints += 2;
  36.             }
  37.             Console.WriteLine("Bonus score: " + bonusPoints);
  38.             Console.WriteLine("Total score: " + (num + bonusPoints));
  39.         }
  40.     }
  41. }
Add Comment
Please, Sign In to add comment