Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //Problem 3.Check for a Play Card
- //Classical play cards use the following signs to designate the card face: 2, 3, 4, 5, 6, 7, 8, 9, 10, J, Q, K and A.
- //Write a program that enters a string and prints βyesβ if it is a valid card sign or βnoβ otherwise.
- using System;
- class CheckPlayCard
- {
- static void Main()
- {
- Console.Write("Please, enter card face: ");
- string card = Console.ReadLine();
- switch (card)
- {
- case "2":
- case "3":
- case "4":
- case "5":
- case "6":
- case "7":
- case "8":
- case "9":
- case "10":
- case "J":
- case "Q":
- case "K":
- case "A":
- Console.WriteLine("Valid card sign? Yes.");
- break;
- default:
- Console.WriteLine("Valid card sign? No.");
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement