Chapter 6; Question4
I'm sure that this has been discussed at length and my input may be very late and outdated, but.... I think I may have found a more effecient answer for question 4 than the book currently suggests (though I was thinking about case statements initially too).
Here is my solution:
class PrintCardDeck
{
static void Print()
{
string[] Suits = { "Spades", "Hearts", "Diamonds", "Clubs" };
string[] Cards = { "2", "3", "4", "5", "6", "7", "8", "9", "10", "Jack", "Queen", "King", "Ace" };
foreach (string Suit in Suits)
{
foreach (string Card in Cards)
{
Console.WriteLine("Card: " + Suit + " / " + Card);
}
}
Console.Read();
}
}