Please help with the following. This needs to be coded in C++
Lab 2: Earning Gear
You will implement a program that hands out gear to the players of a particular game. You may
theme your game as you wish.
Your program will use probabilities to decide what gear to hand out to the player. The gear includes
a dagger, a helment, a shield, and armor.
All of the gear that will be handed out is represented by a token in a bag. To begin, there are 2
daggar tokens, 3 helmet tokens, 3 shield tokens, and 4 armor tokens in the Token Bag.
The program will choose a token from the bag and give that gear to the player. To simulate which
token was chosen, you will compute the probability of choosing each piece of gear and hand out
the gear with the highest probability of being chosen. If there is a tie, the user gets both (or all)
of the gear with the same probability.
You should display the probabilities of each kind of gear in a table before handing out the gear.
See the sample output for how to format the probabilities.
Remember, you cannot directly compare doubles. You have to compare using abs(x-y) < EPSILON
where EPSILON is some very small number, like 1e-14.
Recently Asked Questions
- Explain why it’s so important to take advantage of the FDIC insurance offered by banks.
- I want help with the last question of negotiation assignment, The question is Negotiations have completely broken down, and a Mediator has been appointed by
- Please see the attachment regarding to the question. Thanks for your help.