Question
Write a C++ program that implements a game in which the user first enters the distance to a target. The user then enters the angle
Write a C++ program that implements a game in which the user first enters the distance to a target. The user then enters the angle and velocity for launching a projectile. If the projectile comes within 0.01% of the distance to the target, the user wins the game. If the projectile does not come close enough, the user is told how far off the projectile is and is allowed to try again. If there is not a winning input after five tries then the user loses the game.
To simplify input for the user, your program should have the angle to input in degrees. The formula for converting degrees to radians is
radians = 0.0174533 * degrees
Each of the formulas in this problem should be implemented as a C++ value-returning function. Your program should prompt the user for input appropriately, label the output values and have proper programming style.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started