Question: Programming language is C++ Write a program that simulates picking a card from a deck of 52 cards . Your program should display the rank

Programming language is C++

Write a program that simulates picking a card from a deck of 52 cards. Your program should display the rank (Ace, 2, 3, 4, 5, 6, 7, 8, 9, 10, Jack, Queen, King) and suit (Clubs, Diamonds, Hearts, Spades) of the card. Here is a sample run of the program:

The card you picked is Jack of Hearts

Another run:

The card you picked is 3 of Diamonds

Hint: You can use rand() function and generate two random integers. The first random number should be from 0 to 12 (for the 13 possible ranks) and the second should be from 0 to 3 (for the 4 possible suits). Then use switch-case to show a proper message based on the values of the two random integer numbers generated.

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!