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
- Simple Calculator Given the numbers N1, N2 and an operation character C. Write a simple calculator which performs the 4 basic mathematical operations (i.e.
- Good morning, This is my code. I cannot find my mistake in any way. I tried to solve it by replacing a lot of things, however this is not working. I always
- I cannot see my mistake.