Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The board game Libertalia uses a rather fun card hand management mechanic Which we dont really happen to care about! Each player is given the

The board game Libertalia uses a rather fun card hand management mechanic Which we dont really happen to care about! Each player is given the same thirty card deck of cards to start the game. The cards are numbered uniquely from one to thirty. The game plays out over three acts. Twenty one total cards of the thirty get played in any particular game. For the first act, nine cards are randomly chosen for play. For acts two and three, six of the thirty cards are randomly chosen for play. The remaining cards are not used at all. Cards previously chosen cannot be chosen again in future acts. You are to create a C++ program that chooses and displays the cards for each act/round. Here is representative output that solves the problem: ACT 1: 4 8 10 14 18 22 24 25 26 ACT 2: 1 3 11 17 19 23 ACT 3: 2 9 13 15 27 30 Use exactly the following data structures and process to solve this problem: Use srand() so that each program execution is unique For the deck of cards, create a vector of integer pointers with uniquely created numbers 0 through 29 Use a range-based for loop to increment each value in the vector by one (so afterwards all cards will be in range 1-30 inclusive) Shuffle the deck of cards Create three vectors of integers (not pointers!) which will hold the appropriate number of unique values for its specific act Copy the appropriate numbers from the deck of cards into the back of each vector Sort each of the three vectors Display the contents of each vector, deleting the front element after each distinct number output (See output example above) Sort the original deck of cards back into correct numerical order Make sure to delete and clear the contents of the vector of the deck of cards correctly so there are no memory leaks

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database And Expert Systems Applications 33rd International Conference Dexa 2022 Vienna Austria August 22 24 2022 Proceedings Part 2 Lncs 13427

Authors: Christine Strauss ,Alfredo Cuzzocrea ,Gabriele Kotsis ,A Min Tjoa ,Ismail Khalil

1st Edition

3031124251, 978-3031124259

More Books

Students also viewed these Databases questions

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago

Question

9. Describe the characteristics of power.

Answered: 1 week ago

Question

10. Describe the relationship between communication and power.

Answered: 1 week ago