Need Help ?
Have a Question ?

(Solved): I Need Help Writing This Program, The Language Is C++. The Main Is Already Done For Me, Just Need He ...

When an object is falling because of gravity, the following formula can be used to determine the distance the object falls in

I need help writing this program, the language is C++. The main is already done for me, just need help on writing the functions.

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 = kgt? The variables in the formula are as follows: d is the distance in meters and is the amount of time, in seconds, that the object has been falling. Near the surface of the Earth, the acceleration due to gravity, g, is 9.80665 m/s2 (meters per second squared). Write a function, calculateDistance, that accepts an object's falling time (in seconds) as a parameter. The function should return the distance, in meters, that the object has fallen during that time interval. Write a function, getSeconds, that will prompt the user for the number of seconds an object has been falling. The function should ensure good data is provided by continuing to prompt the user if s/he enters anything non- positive. Once good data has been entered the function should return the number of seconds. C++ allows function overloading, which is when a program contains two or more functions with the same name but with different parameter lists. Write a second function, calculateDistance, which will calculate the distance between two points. Use the following as the function header for this function. double calculateDistance (double xl, double yi, double x2, double y2) The main which has been provided for you for this program includes driver code which will test these three functions. You should not alter the code provided in main.

Expert Answer


Answer:here is the answer for your question : CODE IN C++: #include <stdio.h> #include #include using namespace std; void calculateDistance(double x1, double y1,double x2, doubl
We have an Answer from Expert Buy This Answer $6