Question: the program should be written in C++. Write a struct to represent a playing card. Playing cards have the following features: They have a suit

the program should be written in C++.

  • Write a struct to represent a playing card. Playing cards have the following features:

They have a suit. This suit can be one of the following: clubs, diamonds, hearts, spades They have a rank. Valid ranks are any number between 2 and 10 (inclusive of 2 and 10), plus ace, jack, queen, and king. Define two enums (Suit and Rank) to represent suits and ranks.

  • Write a short main function to generate a random card, and then print the card's rank and suit. Use the rand() function from the library stdlib.h

thank you.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!