Question: Create a code in C: Your program must declare three functions using function prototypes. 2. The first function should be called PrintInstructions 3. This function

Create a code in C:

Your program must declare three functions using function prototypes. 2. The first function should be called PrintInstructions 3. This function takes no arguments and returns an int value, which the caller can use to determine if the user wishes to quit (entered q or Q) the program or continue (any other character). This will require an if/else decision in your main function. 4. The second function should be called GetData. 5. This function must use pointers to get the required inputs (time, velocity, and acceleration) from the user and store the values in the callers local variables in main. 6. The third function is called AccelerationDisplacement.

7. This function will take parameters by value from the caller in main and calculate the distance an object will travel given time, initial velocity and acceleration and return the calculated value as a type double to the caller. 8. The function should perform the calculation of the formula given. 9. The final function is called PrintOutput. 10. This function is called with a value argument and prints the formatted output to the user with the calculations as shown in the required outputs below. The program should then end gracefully.

Formulas:

The formula to determine the distance travelled by an accelerating body is shown below. This is a physics kinematics formula.

d = displacement (distance)

vi = initial velocity

t = time

a = accelerations

d = (vi t) + ( a) t^2

Function Prototypes:

int PrintInstructions()

void GetData(float* , float* , float* )

double AccelerationDisplacement(float vi, float t, float a)

void PrintOutput(double result, float vi, float t, float a)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!