Respuesta :
Answer:
Explanation:
# include <iostream>
# include <iomanip>
using namespace std;
int main(){
// PART 1
const double GRAVITY = 9.81;
double initial_velocity;
cout<<"Enter initial velocity (in m/sec): "; cin >> initial_velocity;
// calculate the time to reach the top
double tm = initial_velocity/GRAVITY;
// max height reached
double Hm = (initial_velocity*initial_velocity)/(2*GRAVITY);
// total elapsed time
double tr = 2*tm;
cout<<"Time taken to reach the top: " << tm << " sec(s)." << endl;
cout<<"Max height attained : " << Hm << " m(s)." << endl;
cout<<"Time to return to reference location: " << tr <<" sec(s)."<< endl << endl;
// Part 2
double sec;
cout<<"Enter the time (in sec): "; cin >> sec;
double Vo = 100; // taking Vo as 100 as mentioned in the question
double V = Vo - GRAVITY*sec ; // calculate the Velocity at time user entered
double H = Vo*sec - (GRAVITY*sec*sec)/2; // height attained at that time
cout<<"Velocity at time "<<sec<<" sec(s) will be: " << V <<" m/s." << endl;
cout<<"Height attained will be " << H <<" m(s). "<< endl;
}
======================================================================