In physics, there is an equation that determines how far a projectile will travel given the height of the original launch and the initial velocity. Assuming that Thelma and Louis drive a car off a cliff, you can determine how far the car will travel horizontally, and how much time it will take to crash if you know how fast the car was traveling and how high the cliff was. Given this scenario, the angle of the trajectory when Thelma and Louise leave the cliff is 0 (that's theta), and gravity is a constant at 9.8. Projectile motion equations make the assumptions of meters for the distance and seconds for time.
Write a program in c++ that solves this problem. You must ask for inputs of the height of cliff and car speed. You will determine distance and time.
The equation for time is: time equals the square root of 2 times the height divided by gravity. The equation for distance is the initial velocity times the square root of 2 times the height divided by gravity.
This is not a homework site. We try to help those who have a specific difficulty with a portion of your code.
So try to write the program and ask for help on specific part. Nobody will do the homework for you.
Your project is pretty simple. You have to ask the user for input, store it in variables and do the math with those variables to get the final answer.
To get you started, below is some general overview of what your program should look like
1 2 3 4 5 6 7 8 9 10 11
#include <iostream>
usingnamespace std;
int main(){
int height;
cout << "Enter height: ";
cin >> height;
// do same thing with speed and other inputs if needed
int finalAns;
finalAns = height*whatever/whatever+whatever; // plug in variables into equations
cout << "Final answer is: " << finalAnswer;
My apologies. I only wanted some assistance because I was confused to as to where I should start. I should've clarified what I was asking. My intentions were not to have someone do the work for me, so I'm sorry for making it seem that way!
Thank you for the help, and, again, very sorry for the lack of clarification!