Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

assume that we would like to use the linear interpolation to determine the coeff

ID: 2972810 • Letter: A

Question

assume that we would like to use the linear interpolation to determine the coefficient of lift for additional flight- path angles that are between -4 degrees and 21 degrees. write a program that allows the user to enter the data for two points and a flight - path angle between those point the program should then compute the corresponding of lift. the coefficient of lift values are (-0.182,-0.056.,0.097,0.238,0.421,0.479,0.654,0.792,0.924,1.035,1.076,1.103,1.120,1.120,1.121,1.099,1.059)

Explanation / Answer

PLEASE RATE ME AND AWARD ME KARMA POINTS IF IT IS HELPFUL FOR YOU SAMPLE RUN The following shows a sample program run using the input file tunnel.txt (user input in bold). Range of flight-path angles: -4 to 21 degrees Please enter a flight-path angle in degrees: -3 Lift coefficient for -3 degrees: -0.119 Would you like to enter another value (Y/N)? y Please enter a flight-path angle in degrees: -5 ****Sorry, -5 is not within data range**** Would you like to enter another value (Y/N)? Y Please enter a flight-path angle in degrees: 5.5 Lift coefficient for 5.5 degrees: 0.59575 Would you like to enter another value (Y/N)? N Here is the data file "tunnel.txt": -4 -0.182 -2 -0.056 0 0.097 2 0.238 4 0.421 6 0.479 8 0.654 10 0.792 12 0.924 14 1.035 15 1.076 16 1.103 17 1.120 18 1.121 19 1.121 20 1.099 21 1.059 And here is my code: Code: ? 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 #include #include #include using namespace std; //Define constants and declare function prototypes const int T=100; double maxval(const double x[], int n); double minval(const double x[], int n); int main() { // Declare objects int tpts(0); double y[T], flight_range, coef_lift; string filename; ifstream tunnel; // Prompt user for file name and open date file. cout > filename; tunnel.open(filename.c_str()); if (tunnel.fail()) { cout > flight_range >> coef_lift; // While there is room in the array and // end of file was not encountered, // assign the value to the array and // input the next value. while (tpts > flight_range; } // Find and print the maximum value cout