Answered>Order 22100

I need help writing the main function, especially the structure for USER_INPUT, what is an example of a similar main function

D. Exercise: Again, the Free Falling Parachutist (60 points) Let‘s use structures/arrays and functions to calculate three different velocities for the free fallingparachutist. Recall that the velocity of the parachutist is given by v(1)= %(l—z"""") The above equation can calculate the velocity over time given the mass and drag coef?cient of theparachutist. At t=0, the velocity of the parachutist is zero. Develop a proyam that gets ?’om the user the weight, drag coef?cient and a time (call this time If).The program calculates the velocity of the parachutist the following times: l= 9/3, t = 25/3, I = 1/. Theprogram 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 so?ware (this table wasgenerated using Micrso? Etcel, see the ?le GNGIIO6Lab4TestCasesrxls), The velocities were computedusing the equation above. ; c t s Veloci ml: mn———nm_—-E 27.77_—-Jil 3564 Use the following guidelines to create your program.1) Symbolic Constantsa. G — set to the value of gravitational constant, 9.8 m/s22) Function ma ina. Data Structures:i. De?ne a structure type “USER_INPUT" which has three members, weight,drag, and t: ime (all oftype double).b. Local Variablesi, input: a structure variable of type USER_INPUT that contains the three inputvalues obtained from the user. ii. velocities: An array with 3 elements oftype double for storing the three velocity values.c. Logic/ Strategiesi, Call a function get Input to prompt the user for the three values weight, dragcoef?cient and time to be stored in the input structure variable (you will need topass a reference to the function). ii. Call a function cal culateVelocities to compute the parachutist’s threevelocity values using the input values provided by the user. The velocity valuesare stored in an army referenced by a parameter (pointer variable). iii. Display the result as shown below. Use the formatting features ofthe printf function to create a well formatted table, f h h . It:‘ antenna: . taker-“t “ *° ‘ ? 2? no uer E (are) execution than 3 26.307 Iey to continue. 3) Function: get-.Input a. This ?mction is quite simple but demonstrates the use of a passed reference to a structurevariable to a function. b. The function has one parameter — a reference to the structure variable for storing theinput values. c. It obtains from the user the values for weight, drag and time and stores them in theappropriate members of the structure variable. 4) Function: calculateVelocities 3. Determine appropriate parameters and local variables for the function. Note that thefunction does not retum any values. b. Calculate the parachutist‘s velocity ?om the values in the structure variable using thegiven equation at three times t= 0/3, t = 20/3, t= t/ where tfwas given by the user. Eachof the velocity values are stored in the array which was declared in main (i.e. when thefunction is called, the reference to the array is passed to this function). Test the program using the provided test case. Show and explain your mnning program to your TAfor marks.

 
"Not answered?"
Get the Answer