Question: c++/ codeBlocks is the current format used for programming. Function and data validation are required. Do not use namespace std; Thanks:) 3460:209 Assignment 5-B Assignment

 c++/ codeBlocks is the current format used for programming. Function anddata validation are required. Do not use namespace std; Thanks:) 3460:209 Assignment

c++/ codeBlocks is the current format used for programming.

Function and data validation are required. Do not use namespace std;

Thanks:)

3460:209 Assignment 5-B Assignment 5-B: Sportsmania Overview The purpose of this assignment is to make sure that you know how to write a program that contains functions and that does basic input, output, flow of control and/or calculations PROGRAM SPECIFICATION For the assignment, we will write a program that simulates the answer to the greatest dodgeball player of all time while using functions In the land of Sportsmania, Aaron, Bob, and Charlie had an argument over which one of them was the greatest dodgeball player of all time. To end the argument once and for all, they agreed on a dodgeball duel. Aaron is a poor shooter and only hits his target with a probability of 1/3. Bob is a bit better and hits his target with a probability of 1/2. Charlie is an expert shooter and never misses. A hit means a part of another player was hit with the ball and that person hit drops out of the duel To compensate for the inequities in their marksmanship skills, it is decided that the contestants would fire in turns starting with Aaron, followed by Bob, and then by Charlie The cycle would repeat until there was one man standing. And that man would be remembered as the greatest dodgeball player of all time a. Write a function to simulate a single shot. It should use the following declaration: void shoot (bool &targetAlive, double accuracy) This would simulate someone shooting at targetAlive 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. You need to generate random numbers For example, if Bob is shooting at Charlie, this could be invoked as: shoot (charlieAlive, 1.0); Here, charlieAlive is a Boolean variable that indicates if Charlie is alive. Test your function using a driver program before moving on to step b

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!