In C++ Code When an object is falling because of gravity, the following formula can be used to determine the distance th

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

In C++ Code When an object is falling because of gravity, the following formula can be used to determine the distance th

Post by answerhappygod »

In C++ Code
When an object is falling because of gravity, the followingformula can be used to determine the distance the object falls in aspecific time period:
d = 1/2 gt2
The variables in the formula are as follows: d is the distancein meters, g is 9.8, and t is the amount of time, in seconds, thatthe object has been falling.
Write a functionnamed fallingDistance that accepts anobject’s falling time (in seconds) as an argument. The functionshould return the distance, in meters, that the object has fallenduring that time interval. Write a program that demonstrates thefunction by prompting the user for the total time and callingthe function in a loop that passes the time values in 5second increments as the argument and displays the elapsed time andreturn value. The output should have a header identifyingthe column names and tabular formatted values (values displayed areto illustrate formatting only):
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply