Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a C code follow the instruction D. Exercise: Again, the Free Falling Parachutist (60 points) Let's use structures/arrays and functions to calculate three different
Write a C code follow the instruction
D. Exercise: Again, the Free Falling Parachutist (60 points) Let's use structures/arrays and functions to calculate three different velocities for the free falling parachutist. Recall that the velocity of the parachutist is given by gm The above equation can calculate the velocity over time given the mass and drag coefficient of the parachutist. At t-0, the velocity of the parachutist is zero Develop a program that gets from the user the weight, drag coefficient and a time (call this time t). The program calculates the velocity of the parachutist the following times: t3, 2tf3,t-t The program will output all input values and the calculated velocities in a table using output formatting. The following table provides a test cases that can be used for testing the software (this table was generated using Micrsoft Excel, see the file GNG1106Lab4TestCases.xls). The velocities were computed using the equation above WeightDrag Coefficient,Time t Velocity (m/s 68.1 12.5 2.0 4.0 6.0 16.40 27.77 35.64 Use the following guidelines to create your program. 1) Symbolic Constants a. G - set to the value of gravitational constant, 9.8 m/s 2) Function main a. Data Structures i. Define a structure type "USER_INPUT" which has three members, weight, drag, and time (all of type double) b. Local Variables i. input: a structure variable of type USER_INPUT that contains the three input values obtained from the user velocities: An array with 3 elements of type double for storing the three velocity values ii. c. Logic/Strategies i. Call a function getInput to prompt the user for the three values weight, drag coefficient and time to be stored in the input structure variable (you will need to pass a reference to the function). Call a function calculateVelocities to compute the parachutist's three velocity values using the input values provided by the user. The velocity values are stored in an array referenced by a parameter (pointer variable) Display the result as shown below. Use the formatting features of the printf function to create a well formatted table. ii. iii. 106 Please enter the weight: ease enter the drag: 12 lease enter the time span: 6.0 Velocities for the parachutist with weight 68. 10 ks a drag coefficient Time Velocity m/s kg/s are 6.00 rocess returned 20 (0x14) execution time : 26.007 s ress any key to cont i nueStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started