Advertisement
dimipan80

5.2ConditionalStatements_BonusScore

Mar 21st, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.87 KB | None | 0 0
  1. using System;
  2.  
  3. class BonusScore
  4. {
  5.     static void Main ()
  6.     {
  7.         Console.Write("Please, enter a whole number in the range [1 ... 9], SCORE = ");
  8.         string inputStr = Console.ReadLine();
  9.         int score = int.Parse(inputStr);
  10.  
  11.         if (score > 0 && score < 10)
  12.         {
  13.             if (score >= 1 && score <= 3)
  14.             {
  15.                 Console.WriteLine("Your Final Score is: {0} !", (score * 10));
  16.             }
  17.             else if (score >= 4 && score <= 6)
  18.             {
  19.                 Console.WriteLine("Your Final Score is: {0} !", (score * 100));
  20.             }
  21.             else
  22.             {
  23.                 Console.WriteLine("Your Final Score is: {0} !", (score * 1000));
  24.             }
  25.         }
  26.         else
  27.         {
  28.             Console.WriteLine("Input Error - Invalid score !!!");
  29.         }
  30.         Console.ReadLine();
  31.     }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement