...

/

Challenge: Lets Play Cards

Challenge: Lets Play Cards

Here is a playing cards coding challenge based on the concepts covered in this chapter.

This coding challenge has been further divided into multiple parts for your ease and maximum learning.

Problem statement 1

Design a struct named Card to represent a playing card.

This struct can have two members:

  • suit
  • value
svg viewer

It may make sense to use an enum to represent the suit, or you can simply use the characters ♠, ♡, ♢, and ♣.

An int or a dchar value can be used for the card value. If you decide to use an int, the values 1, 11, 12, and 13 may represent the cards that do not have numbers (ace, jack, queen, and king).

There are other design choices to make. For example, the card values can be represented by an enum type as well.

The way objects of this struct will be constructed will depend on the ...