Can someone help correct my C++ code thank you! Chapter 1 Exercise 10 Freefall W
ID: 3664867 • Letter: C
Question
Can someone help correct my C++ code thank you!
Chapter 1 Exercise 10
Freefall
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 freefall for that length of time. Assume no friction or resistance from air and a constant acceleration of 32 feet per second due to gravity.
Use the relation: distance = one half times acceleration * the square of length of time.
INPUT and PROMPTS. The program uses this prompt "Enter a time in seconds." for the length of time it reads in. The length of time is expected to be an integer (i.e. no decimals). Do not print the numberout after it has been read in.
OUTPUT . The output is "An object in freefall for x seconds will fall y feet." where x is the value the user typed in and y is the falling distance computed by your program .
#include<iostream>
#include<cstdlib>
using namespace std;
void main ()
int time;
double distance;
cout<< "Enter time in seconds ";
cin >> time;
distance = 0.5*32*sqrt(time);
cout<<"An object in fretful for" <<time<< "seconds will fall" << distance <<"feet."<<endl;
system("pause");
}