grach

BonusScore

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