Advertisement
Kuncavia

BonusScore

Sep 14th, 2016
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.77 KB | None | 0 0
  1. using System;
  2. class BonusScore
  3. {
  4.     static void Main(string[] args)
  5.     {
  6.         Console.WriteLine("Enter score : ");
  7.         var num = int.Parse(Console.ReadLine());
  8.         var bonusPoints = 0.0;
  9.         if (num <= 100)
  10.         {
  11.             bonusPoints = 5;
  12.         }
  13.         else if ((num > 100) && (num <= 1000))
  14.         {
  15.             bonusPoints = num * 0.20;
  16.         }
  17.         else if (num > 1000)
  18.         {
  19.             bonusPoints = num * 0.10;
  20.         }
  21.         if (num % 2 == 0)
  22.         {
  23.             bonusPoints += 1;
  24.         }
  25.         else if (num % 10 == 5)
  26.         {
  27.             bonusPoints += 2;
  28.         }
  29.         Console.WriteLine("Bonus score: {0}", bonusPoints);
  30.         Console.WriteLine("Total score: {0}", num + bonusPoints);
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement