The infinite loop is caused by the variable 'sec' being re-declared inside the while loop and being used in the test condition. Modifying the variable within the loop does not affect the global variable due to variable scope; remove the re-declaration and initialize the value to zero before the loop start.
Also, here are a few other items:
The header line likely does not need to be reprinted on each pass; move it above the loop.
The 'fixed' and 'setprecision(3)' lines do not need to be executed in each pass; move them above the loop.
The lines that contain 'endl' do not need to output '\n' unless you want the extra blank lines in between each output line.
Unless I am missing it, there appears to be no code that sets a value for 'x' and 'y'; those values will always display the initialized value (zero).
}
double myRange = range(sph, g_m, thetaDegrees);
cout << fixed;
cout << setprecision(3);
cout << myRange << " feet(Range)\n";
cout << timer(myRange, thetaDegrees, sph) << " secs in air\n";
cout << left << setw(25) << "Total Flight Time(secs)";
cout << left << setw(25) << "Horizontal Distance(ft)";
cout << left << setw(25) << "Height(ft)" << endl;
while (sec <= timer(myRange, thetaDegrees, sph))
{
sec = sec + (timer(myRange, thetaDegrees, sph) / 50.0);
cout << left << setw(25) << sec;
cout << left << setw(25) << x;
cout << left << setw(25) << y << endl;
}
}