SHARE
TWEET

Exercise10BonusScores

g-stoyanov Nov 30th, 2012 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. using System;
  2.  
  3. class Exercise10BonusScores
  4. {
  5.     static void Main()
  6.     {
  7.         byte number;
  8.         Console.Write("Please enter number (1...9): ");
  9.         bool input = byte.TryParse(Console.ReadLine(), out number);
  10.         switch (number)
  11.         {
  12.             case 1:
  13.             case 2:
  14.             case 3:
  15.                 Console.WriteLine("\nBonus score is: " + number * 10);
  16.                 break;
  17.             case 4:
  18.             case 5:
  19.             case 6:
  20.                 Console.WriteLine("\nBonus score is: " + number * 100);
  21.                 break;
  22.             case 7:
  23.             case 8:
  24.             case 9:
  25.                 Console.WriteLine("\nBonus score is: " + number * 1000);
  26.                 break;
  27.             default:
  28.                 Console.WriteLine("\nError, input is not valid number!");
  29.                 break;
  30.         }
  31.  
  32.     }
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top