Question: need help in assignment for discrete structures. must be written in C++: You will implement a program that hands out gear to the players of
need help in assignment for discrete structures. must be written in C++:






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 Your Program All of the gear that wll 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 cach 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 Sce the sample output for how to format the probabilities Remember, you cannot directly compare doubles. You have to compare using abs(x-y) where EPSILON is some very small number, like le-14. EPSILON
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
