Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You are an engineer assigned to a program to develop a relatively cheap vehicle to deliver satellites to earth orbit. During launch of the vehicle,

You are an engineer assigned to a program to develop a relatively cheap vehicle to deliver satellites to earth orbit. During launch of the vehicle, the rocket must reach a vertical velocity larger than 1000 m/s during the first 40 seconds after launch. The rockets instruments include an altimeter. Your job is to write a program to take the numerical derivative of the altitude data to find the velocity. A sample file containing time and altitude data from the last launch is available to you (on the course web site) to test your program. Your program should: a) Use doubles for all variables used in the derivative calculation. b) Read in the time and altitude data from the sample file. c) Make use of any appropriate loops to find the velocity. You should use the central difference equation to find the velocity for all time points, except for the first and last time points. d) For each time point, save the time, altitude, and velocity to a data file in table format so that they can be read into a graphing program. To help you, Ive developed pseudocode for the program below: 1) Declare an object of type ifstream, and use it to open alt_data.dat (the input file). 2) Declare an object of type ofstream, and use it to open a file for output. (A good way to do this might be to prompt the user for a filename.) 3) Read the first time and altitude data from alt_data.dat into variables time1 and alt1. 4) Read the second time and altitude into time2 and alt2. 5) Read the third time and altitude into time3 and alt3. 6) While not at the end of the file, a) v2 = (alt3 - allt1)/(time3 - time1) b) Write time2, alt2, and v2 to the output file. c) Set time1 = time2, time2 = time3 d) Set alt1 = alt2, alt2 = alt3 e) Read new time3 and alt3 from the file 7) Close both the input and the output files

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

what is the difference between direct and indirect rates?

Answered: 1 week ago