Question

In: Computer Science

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

When an object is falling because of gravity, the following formula can be use to determine the distance that object falls in a specific 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 been falling.

Design a function called fallingDistance() that accepts an object's falling time (in seconds) as an argument. The function should return the distance, in meters, that the object has fallen during that time interval. Design a program that calls the function in a loop that passes the values 1 through 10 as arguments and displays 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 itself and 1. For example, the number 5 is a prime because it can only be evenly divided by 1 and 5. The number 6, however, is not prime because it can be divided evenly by 1, 2, 3, and 6.

Solutions

Expert Solution

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 <iostream>
#include <iomanip>

using namespace std;

const double GRAVITY = 9.8;

// Function prototypes
double fallingDistance(float);

int main()
{
    cout << "Seconds\t\tMeters"<<endl;
      
  
    for(float T = 1.0; T <= 10; T++)
    {
        cout<< fixed<<setprecision(1) << T << "\t\t"<<fallingDistance(T) << endl;
    }
    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


Related Solutions

Use StatCrunch to determine the count and percentage of observations falling in each of these intervals...
Use StatCrunch to determine the count and percentage of observations falling in each of these intervals by following the instructions listed below or using another appropriate counting method. Properly label and list these counts and percentages in your document. Start in the “Body Temp” data set. Go to Data  Row Selection  Interactive Tools. In the slider selectors box, click the variable Body Temp into the variable box. Then Click compute. I got this answer: 68% of the data...
a. Use the appropriate formula to determine the periodic deposit.
a. Use the appropriate formula to determine the periodic deposit. b. How much of the financial goal comes from deposits and how much comes from interest? 
PLEASE USE FORMULA AND NOT EXCEL SO I CAN UNDERSTAND HOW TO USE FORMULA THE INITIAL...
PLEASE USE FORMULA AND NOT EXCEL SO I CAN UNDERSTAND HOW TO USE FORMULA THE INITIAL QUESTION: Gerald has taken out a loan of $100,000 today to start a business. He has agreed to repay the loan on the following terms: Repayments will be made on a monthly basis. The first repayment will be made exactly one month from today. The repayments for the first 5 years will cover interest only to help reduce the financial burden for Gerald’s business...
What are four indicators that you can use to determine when strategies are not having the...
What are four indicators that you can use to determine when strategies are not having the desired result?
Radioactive decay can be used to determine the age of an object. If you know the...
Radioactive decay can be used to determine the age of an object. If you know the number of radioactive nuclei with which an object started, the number of radioactive nuclei currently present, and the half-life of the isotope, you can calculate the time since the object was created. Suppose an object was created with 4.810×109 nuclei of a particular isotope that has a half-life of 1.56×103 yr. At this point in time 9.620×108 nuclei of this particular isotope remain. What...
When managing activity risk, you can use ____ to determine the source and type of any...
When managing activity risk, you can use ____ to determine the source and type of any significant risks Select one: a. Qualitative Risk Analysis b. Quantitative Risk Analysis c. Root Cause Analysis d. Monte Carlo Simulation
Which of the following is correct?   A. When marginal product is falling, total product must be...
Which of the following is correct?   A. When marginal product is falling, total product must be falling.    B. All of the other answers are incorrect    C. When marginal product is falling, total product must also be falling.    D. Marginal product rises faster than total product and also falls faster than marginal cost.    E. When total product is rising, both average product and marginal cost must also be rising.
How can you determine the type of charge on an object using an electroscope that has...
How can you determine the type of charge on an object using an electroscope that has a net charge of unknown sign? Explain in connection with Triboelectric Series.
Using thevthin lens equation, determine the location and size of eac image of the object when...
Using thevthin lens equation, determine the location and size of eac image of the object when it is at the 10 cm mark, the 20 cm cause next lens (objective) is at the 80 cm mark and the 10 cm lens (eyepiece) is placed at the 114 cm mark. How many times larger is the final image when the eyepiece is at the 116 cm mark?
Ayayai Inc. is trying to determine whether to use the FIFO or average cost formula. The...
Ayayai Inc. is trying to determine whether to use the FIFO or average cost formula. The accounting records show the following selected inventory information: Purchases Cost of Goods Sold Ending Inventory Date Units Cost Total Units Cost Total Units Cost Total Oct. 2 9,600 $13 $124,800 9,600 $13 $124,800 15 16,000 15 240,000 [1] [2] [3] [4] [5] 29 21,400 [6] [7] [8] [9] [10] [11] [12] [13] The company accountant has prepared the following partial statement of income to...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT