language: C++11 (gcc-4.7.2)
date: 70 days 2 hours ago
link:
visibility: public
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <iostream>
#include <iomanip>
#include <cmath>
 
int main()
{
    int x=60; //x is the measure of angle in degrees.
    int V= 144; //Initial velocity
        double t= 0.5; //Seconds
        double h; // height
        
 
        std::cout <<  "Time" << '\t'
        << "Height" << std::endl;
        while(t<=8.0)
        {
            h = V*t*sin(x*M_PI/180)- 16*t*t;
            std::cout <<  t << '\t' << h << std::endl;
            t += 0.5;
        }
        return 0;
}