int main()
{
char ans;
double thrustCurve[MaxValues][2];
double time = 0;
enterThrustData(thrustCurve);
do
{
cout << "\nEnter a time: ";
cin >> time;
cout << "The thrust at time is " << time << fixed << setprecision(1)
<< getThrustData(time, thrustCurve) << " Newtons.\n";
cout << "Would you like another thrust value? (Y or N): ";
cin >> ans;
}
while (ans=='y' || ans=='Y');
cout << "\n\nEnd Program.\n";
return 0;
}
//
//
//
double enterThrustData(double thrustCurve[MaxValues][2])
{
string junk;
double dataTime =0;
double dataThrust =0;
int i = 1;
int j = 0;
cout << "Enter thrust curve data (0 for thrust to end list): " <<endl;
do
{
dataTime =i;
dataThrust =j;
getline (cin,junk);
{
cin >> dataTime >> dataThrust;
thrustCurve[i][0] = dataTime;
thrustCurve[1][j] = dataThrust;
}
}
while(dataThrust !=0);
i++;
return thrustCurve[i][j];
}
//
//
//
double calcthrust(double time, const double thrustCurve[MaxValues][2])
{
double Newtons;
int i=0;
int j=0;