Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

When an object is falling because of gravity, the following formula can be used

ID: 3638644 • Letter: W

Question

When an object is falling because of gravity, the following formula can be used to determine the distance
the object falls in a specific time period:
d = ½ (gt2)
The variables in the formula are as follows: d is the distance in meters, g is 9.8, and t is the amount of
time, in seconds, that the object has been falling.
Assume you are standing atop the Engineering Research Center, holding a ketchup-filled water balloon.
The dean is walking by in a bright, clean white hat, soon to arrive right underneath your perch. And
temptation strikes. And is irresistible.
Assume the Dean is walking X meters / second, and you are now standing Y meters above the Dean’s
path. You try to drop the balloon when the Dean is Z meters away from the spot below you, and you must
guarantee the strike. Write a program to determine Z using inputs X and Y given by cin.
You have to use a function to calculate the number of seconds for the water balloon to hit the Dean, and
another function to calculate the Z value for you to drop the water balloon. So, including the main
function, your program must contain at least three functions. Finally, you use cout to display the Z value.
Do NOT use X, Y, Z as variable names in your program, as these are not meaningful identifier.

Explanation / Answer

//Ans to ques

#include<iostream.h>
#include<math.h>

float time_to_hit(float height) //Finds time of fall
{
float time;
time = sqrt((2*height)/9.8);
return(time);
}

float distance_dean(float time,float speed) //Calculates when to throw
{
float distance;
distance = time*speed;
return(distance);
}

int main()
{
float dist_dean,height_above,speed_dean,time;
cout<<"Enter Speed at which dean is travelling ";
cin>>speed_dean;
cout<<" Enter Heaight above which you are standing ";
cin>>height_above;
time = time_to_hit(height_above); //Call func to find falling time
dist_dean = distance_dean(time,speed_dean); //Call func to find disance away to throw
cout<<" Distance of dean from building when you release water balloon is : "<<dist_dean;
return(0);
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote