#define _USE_MATH_DEFINES // for C++
#include <cmath>
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
// declaring variables:
double height, velocity, height2, time2, range;
int time, angle;
//Output of height and time based on User input:
height2 = height + velocity * time - (4.9 * pow(time,2.0));
cout << "The height at time " << time << " is " << fixed << setprecision(2) << height2 << " meters." << endl;
time2 = 2 * velocity / 9.8;
cout << "At time " << fixed << setprecision(1) << time2 << " seconds, the cannonball hits the ground." << endl;
//Leaving space between table and rest of output:
cout << " " << endl;
Every time I submit it I get these issues:
hint: First line of Angle-Range table output wrong for input 111, 222, 3.
hint: Your code did not generate the expected range output for 500.0, 10.0, 10, angle 60.
Does anybody have any idea what the problem is. Any help is greatly appreciated.