Question: Can someone tell me what is wrong with my code I've done? I cannot get it to output the correct numbers. Task 2 (9 Points)

Can someone tell me what is wrong with my code I've done? I cannot get it to output the correct numbers.

Can someone tell me what is wrong with my code I've done?

I cannot get it to output the correct numbers. Task 2 (9Points) The projectile motion of an object fired straight up into the

Task 2 (9 Points) The projectile motion of an object fired straight up into the air can be modeled using the equation below: 1 h= at? + vot + ho 2 Where a is the acceleration due to gravity Wo is the initial speed in meters per second hy is the initial distance above ground in meters tis time in seconds h is the height of the projectile above the ground in meters. Write a program named launcher.cpp that: Prompts the user for a value for vo and ho Implements a function named computeDistance() that calculates the distance from the ground o Return type: double (h) O Parameter(s): double (vo), double (hi), double (1) Calls the computeDistance() function to display the values for the motion of a projectile in 0.1-second intervals starting at launch (* = 0) and until the projectile hits the ground (i.e. d 1.9 1.31 2.0 0.40 PROJECTILE IMPACT AFTER 2.0 SECONDS Max height was at 1.02 seconds with a height of 5.10 meters. 2 3 4 5 6 7 #include #include using namespace std; 10 11 double computeDistance (double t, double ve, double ho) //the function computeDistance calculates the distance from the ground { double d; d = -(0.5 * 9.8 * t*t) + (v@ * t) + h;//returns answer as result d return d; } le double maxDistance (double ho, double ve, double& t) //function maxDistance calculates maximum height of projectile. { double max = (VO * Vo) / (2 * 9.8) + he; t = vo / 9.8; return max; } 14 15 16 17 18 19 20 21 22 26 27 28 int main() { double he, ve; cout > v; cout > he; double t = ; double h - computeDistance(t, he,vo); while (h >= 0) { cout

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!