#include <iostream>
#include <cmath>
using namespace std;
const float G = 32.17;
// function declaration
float caltime ( float,float, float );
float calheight ( float,float,float);
// main function
int main()
{
float theta, float cotheta, float sitheta, float distance, float velocity, float time, float height;
cout << " Input the angle of elevation : " << endl;
cin >> theta;
cotheta = cos(theta);
sitheta = sin (theta);
cout << " Input the distance : " << endl ;
cin >> distance;
//use function
time = caltime ( distance,velocity, cotheta);
height = calheight ( velocity, sitheta, time) ;
cout << " The flight will reach in the target within"<< time << "second " << endl;
cout << " The height will be " << height << "ft above the ground" << endl;
system ("pause");
return 0;
}
float caltime ( float x, float y, float z)
{
float timefind;
timefind = x/(y * cotheta);
return timefind;
}
float calheight (float a,float b, float c)
{
float heightfind;
heightfind = ( a * b * c - (G * c*c /2))
return heightfind;
}
13 C:\Documents and Settings\QuynhlNguyen\My Documents\Final\find time and height.cpp expected unqualified-id before "float"