ASSIGNMENT 3 PLEASE ONLY USE CODE BLOCK C to do the softwa
ASSIGNMENT #3 PLEASE ONLY USE \" CODE BLOCK C++ \" to do the software below:
A small test rocket is being designed for use in testing a retrorocket that is intended to permit “soft” landings. The designers have derived the following equations that they believe will predict the performance of the test rocket. (t = elapsed time in seconds) 6.07t2.751 Acceleration in ft/sec2 = 4.25 - .015t2 + ------------ 9995 .015t3 6.07t3.751 Velocity in ft/sec = 4.25t - -------- + ------------- 3 3.751(9995) 4.25t2 .015t4 6.07t4.751 Distance in ft = 90 + -------- - -------- + ------------ 2 12 4.751(37491) Note: The distance equation gives the height above ground level at time t and the first term (90) is the height in feet above ground level of the launch platform that will be used. In order to check the predicted performance, the rocket will be “flown” on a computer, using the derived equations. Write a program to cover a maximum flight of 100 seconds. The output should be of the following form: TIME ACCELERATION VELOCITY DISTANCE (sec) (ft/sec2) (ft/sec) (ft) XXX.XX XXX.XX XXX.XX XXXX.XX (starting with 0.0 sec) Increments of time are to be 2.0 seconds, from launch through the ascending and descending portions of the trajectory until the rocket descends to within 60 feet of ground level. Below 60 feet the time increments are to be 0.05 seconds. If the rocket impacts prior to 100 seconds, the program is to be stopped immediately after impact. Your program must include functions for acceleration, velocity, distance and the heading for the output report. . . Demonstrate your output in the lab. You are required to demonstrate your program in the lab.
Solution
Start with implementing functions which would take time and return acceleration/velocity/distance
Then create variable to hold increment.
Create a loop like: for(double time = 0.0; time <= 100.0; time += increment)
Inside a loop do calculations, output them on screen.
Check for impact. break from the loop if needed
Check if below 50 feet. Set increment to 0.05 if so.
Add other things as needed.
Edit: reference output
