Question
please attach the screenshot of the code Write a C++ program that displays a table of x and y values for a projectile fired with
please attach the screenshot of the code
Write a C++ program that displays a table of x and y values for a projectile fired with an initial velocity of 500 ft/sec at an angle of 22.8 degrees. The table should contain values corresponding to the time interval 0 to 10 seconds in increments of 1/2 seconds.
The x and y coordinates, as a function of time t of a projectile fired with an initial velocity v, at an angle of ? degress with respect to the ground, are given by these formulas:
x = v t cos ?
y = v t sin ?
Note. The library functions sin and cos take only radians, convert degrees to radians before calling the functions.
2. Modify the code to prompt for the velocity and the angle in degrees. The program should answer the question, how far does the projectile go (i.e. when y-coordinate becomes zero, x-coordinate is the distance traveled) and how long it took to travel (i.e. when y-coordinate becomes zero, t is the time of travel). In other words, run the loop long enough until y-coordinate becomes less than or equal to zero.
Include a comment with your name, course code and date.
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