(Solved): I Need Help Writing This Program, The Language Is C++. The Main Is Already Done For Me, Just Need He ...
I need help writing this program, the language is C++. The main
is already done for me, just need help on writing the
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.