View the step-by-step solution to:


In Card class and a Deck class that stores a deck of these Cards.

Then, use the Monte Carlo method to

determine the odds of receiving at least one pair in a hand of cards. A pair is any two cards with the same rank.

Along with outputting to the terminal the percentage of times a pair is found, your program should also give the user the option to output to a file the contents of each hand and whether it found a pair in that hand. Be sure to reshuffle the deck between each deal (simulation).

Your main function should seed the random function with the seed 2222.

Given this seed, here is what a sample run of your program will look like if the user chooses NOT to output to a file:

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question
Let our 24/7 C++ Programming tutors help you get unstuck! Ask your first question.
A+ icon
Ask Expert Tutors You can ask You can ask You can ask (will expire )
Answers in as fast as 15 minutes
A+ icon
Ask Expert Tutors