Write a program that allows the user to enter a time in seconds and then outputs how far an object would drop if it is in free fall for that length of time. Assume that the object starts at rest, there is no friction or resistance from air, and there is a constant acceleration of 32 feet per second due to gravity. Use the equation: distance = acceleration x time-squared divided by 2

Respuesta :

Answer:

// here is code inn c++.

#include <bits/stdc++.h>

using namespace std;

// main function

int main()

{

// variable

   int t;

   double acc=32;

   cout<<"Enter the time in seconds:";

   // read the time in seconds

   cin>>t;

   // Calculate the distance=acceleration x time-squared divided by 2

   double dis=acc*(t*t)/2;

   // print the distance

   cout<<"distance is: "<<dis<<" feet."<<endl;

return 0;

}

Explanation:

Read the time in seconds from user and assign it to variable "t". declare and initialize variable "acc" with 32.Find the distance as "dis=acc*(t*t)/2". Print the distance.

Output:

Enter the time in seconds:10

distance is: 1600 feet.