Computers and Technology

In the land of Puzzlevania, Aaron, Bob and Charlie had anargument over which one of them was the greatest puzzler of alltime. To end the argument once and for all, they agreed on a duelto the death. Aaron is a poor shooter and only hits his target witha probability of 1/3. Bob is a bit better and hits his target witha probability of 1/2. Charlie is an expert marksman and nevermisses. A hit means a kill and the person hit drops out of the duel. To compensate for the inequities in their marksmanshio skills, it is decided that the contestants would fire in turns startingwith Aaron, followed by Bob, and then by Charlie. The cycle wouldrepeat until there was one man standing. And that man would beremembered as the greatest puzzler of all time.

Required:
a. Write a function to simulate a single shot. It should use the following declaration: void shoot (bool&targetAlive, doubleaccuracy); This would simulate someone shooring attargetAlive with the given accuracy by generating a random number between 0 and 1. If the random number is less than accuracy, then the target is hit and targetAlive should be set to false. For example, if Bob is shooting at Charlie, this could be invoked as: shoot(charlieAlive, 0.5);

b. An obvious strategy is for each man to shoot at the most accurate shooter still alive on the grounds that this shooter is the deadliest andhas the best chance of hitting back. Write a second function named startDuel that uses the shootfunction to simulate an entire duel using this strategy. It should loop until only one contestant is left, invoking hte shoot function with the proper target andprobability of hitting the target according to who isshooting. The function should return a variable that indicate who won the duel.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 24.06.2019 11:00, maddiiie128
Why is it uncommon for users to perform searches directly in database tables? a.)users are discouraged from interacting directly with tables because they might confuse tables with spreadsheets. b.) users are discouraged from interacting directly with tables because this may result in unintended changes to source data. c.)users do not have the technical skills required to perform searches directly in database tables. d.)users do not have the permissions required to perform searches directly in database tables.
Answers: 1
image
Computers and Technology, 24.06.2019 13:30, sweeps8758
Which type of excel chart should be used to track students’ progress on test grades? line column bar pie
Answers: 2
image
Computers and Technology, 24.06.2019 16:00, miner12924owhu4d
5.a fishing rod is formed from a composite material of 0.5 kg of glass fibers embedded in a matrix of 0.5 kg of epoxy resin. the glass fibers are assumed to be long, continuous and unidirectional. to achieve a greater stiffness it is proposed to use a different composite that is comprised of long continuous carbon fibers that will be embedded in a matrix of 0.5 kg of epoxy resin. if the modulus of elasticity of the carbon fiber composite is 10% greater than the elastic modulus of the glass fiber composite, estimate the mass of carbon fibers that will be used to make the carbon fiber composite. assume the applied tensile stress is parallel to the direction of the long axis of the fibers. the epoxy resin, glass fiber, and carbon fiber have an elastic modulus of 5, 86, and 350 gpa respectively and a density of 1100, 2500, and 1800 respectively.
Answers: 3
image
Computers and Technology, 24.06.2019 18:00, Pfaith8617
Explain the circumstances for which the interquartile range is the preferred measure of dispersion. what is an advantage that the standard deviation has over the interquartile range? choose the correct answer below. a. the interquartile range is preferred when the distribution is symmetric. an advantage of the standard deviation is that it increases as the dispersion of the data increases. b. the interquartile range is preferred when the data are not skewed or no have outliers. an advantage of the standard deviation is that it uses all the observations in its computation. c. the interquartile range is preferred when the distribution is symmetric. an advantage of the standard deviation is that it is resistant to extreme values. d. the interquartile range is preferred when the data are bell shaped. an advantage of the standard deviation is that it is resistant to extreme values. e. the interquartile range is preferred when the data are skewed or have outliers. an advantage of the standard deviation is that it uses all the observations in its computation. f. the interquartile range is preferred when the data are bell shaped. an advantage of the standard deviation is that it increases as the dispersion of the data increases.
Answers: 2
Do you know the correct answer?
In the land of Puzzlevania, Aaron, Bob and Charlie had anargument over which one of them was the gre...

Questions in other subjects:

Konu
Mathematics, 05.05.2020 02:03
Konu
Mathematics, 05.05.2020 02:03