Started by Zexion, February 05, 2013, 08:18:30 pm
if A //Do something hereelse if B //Do something else hereelse if C //i dunno lulz
if A //Do something hereif B //Do something else hereif C //i dunno lulz
#include <iostream>#include <iomanip>#include <cmath>using namespace std;main(){ int incr=0; double start=0.0, end=0.0, alt=0.0, vel=0.0; cout << "Type the starting time, increments, and ending time in hours: "; cin >> start >> incr >> end; while (end > 48) { cout << "The maximum end time is 48." << endl << "Please type another end time." << endl; cin >> end; } cout << "Time" << setw(20) << "Altitude (m)" << setw(22) << "Velocity (m/s)" << endl; while ( start <= end ) { alt = ((-0.12 * pow(start,4)) + (12 * pow(start,3)) - (380 * pow(start,2)) + (4100 * start) + 220); vel = ((-0.48 * pow(start,3)) + (36 * pow(start,2)) - (760 * start) + 4100) / 3600; cout << setprecision(0) << setw(2) << start << setprecision(2) << fixed << setw(20) << alt << setw(20) << vel << endl; start += incr; } system("pause");}