When an object is falling because of gravity, the following formula can be use to determine...

Free

90.2K

Verified Solution

Question

Programming

When an object is falling because of gravity, the followingformula can be use to determine the distance that object falls in aspecific time period:

d = 1/2 g t*t

The variables in the formula are as follows:

d is the distance in meters

g is 9.8

t is the amount of time, in seconds that the object has beenfalling.

Design a function called fallingDistance() that acceptsan object's falling time (in seconds) as an argument. The functionshould return the distance, in meters, that the object has fallenduring that time interval. Design a program that calls the functionin a loop that passes the values 1 through 10 as arguments anddisplays the return value.

  • 5 Falling Distance (5 points)

Seconds        Meters
1.0           4.9
2.0           19.6
3.0           44.1
4.0           78.4
5.0           122.5
6.0           176.4
7.0             240.10000000000002
8.0           313.6
9.0           396.90000000000003
10.0             490.0

A prime number is a number that is only evenly divided by itselfand 1. For example, the number 5 is a prime because it can only beevenly divided by 1 and 5. The number 6, however, is not primebecause it can be divided evenly by 1, 2, 3, and 6.

Answer & Explanation Solved by verified expert
4.0 Ratings (782 Votes)

In case of any queries,please comment. I would be very happy to assist all your queries.Please give a Thumps up if you like the answer.

C++ Program


#include
#include

using namespace std;

const double GRAVITY = 9.8;

// Function prototypes
double fallingDistance(float);

int main()
{
    cout << \"Seconds\t\tMeters\"<       
  
    for(float T = 1.0; T <= 10; T++)
    {
        cout<< fixed<     }
    cout << endl;
    return 0;
}

double fallingDistance(float T)
{
   return .5 * GRAVITY * T*T;
}

Output

Seconds       Meters
1.0       4.9
2.0       19.6
3.0       44.1
4.0       78.4
5.0       122.5
6.0       176.4
7.0       240.1
8.0       313.6
9.0       396.9
10.0       490.0


Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students