Advertisement
tsvetelinapasheva

TsvetelinaPasheva/ConditionalStatementsExercise/02.BonusScore

Jan 16th, 2021
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.86 KB | None | 0 0
  1. using System;
  2.  
  3. namespace ConsoleApp8
  4. {
  5.     class Program
  6.     {
  7.         static void Main(string[] args)
  8.         {
  9.             int number = int.Parse(Console.ReadLine());
  10.             double bonusPoints = 0.0;
  11.  
  12.             if (number <= 100)
  13.             {
  14.                 bonusPoints = 5;
  15.             }
  16.  
  17.             else if (number > 1000)
  18.             {
  19.                 bonusPoints = number * 0.10;
  20.             }
  21.  
  22.             else
  23.             {
  24.                 bonusPoints = number * 0.20;
  25.             }
  26.  
  27.             if (number % 2 == 0)
  28.             {
  29.                 bonusPoints = bonusPoints + 1;
  30.             }
  31.  
  32.             else if (number % 10 == 5)
  33.             {
  34.                 bonusPoints = bonusPoints + 2;
  35.             }
  36.  
  37.             Console.WriteLine(bonusPoints);
  38.             Console.WriteLine(number + bonusPoints);
  39.         }
  40.     }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement