Advertisement
coasterka

#5CheckForAPlayCard

Mar 27th, 2014
258
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.96 KB | None | 0 0
  1. using System;
  2.  
  3. class CheckForAPlayCard
  4. {
  5.     static void Main()
  6.     {
  7.         Console.WriteLine("Enter a string to check whether it's a play card sign.");
  8.         string userInput = Console.ReadLine();
  9.         switch (userInput)
  10.         {
  11.             case "2":
  12.             case "3":
  13.             case "4":
  14.             case "5":
  15.             case "6":
  16.             case "7":
  17.             case "8":
  18.             case "9":
  19.             case "10":
  20.             case "J":
  21.             case "j":
  22.             case "Q":
  23.             case "q":
  24.             case "K":
  25.             case "k":
  26.             case "A":
  27.             case "a":
  28.                 {
  29.                     Console.WriteLine("{0} is a valid play card sign.", userInput);
  30.                     break;
  31.                 }
  32.             default:
  33.                 {
  34.                     Console.WriteLine("{0} is not a valid play card sign.", userInput);
  35.                     break;
  36.                 }
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement