Using C programming
Description: You have been tasked to design an application for an engineering firm to measure the performance of their vehicle designs. The user, an engineer will enter data into your program when prompted and will perform the required calculation and output the answer. The formula used for this project calculates the distance an object will cover in meters given an initial velocity, a rate of acceleration and a time of acceleration or travel.
1. 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 or Boolean 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 caller’s local variables in main (upward communication).
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. You may use the pow() function pp 191 of the text.
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) •
#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
int PrintInstructions(void);
void GetData(float*, float*, float*);
double AccelerationDisplacement(float, float, float);
void PrintOutput(double, float, float, float);
int main() {
char c;
float time, velocity, acceleration;
double d;
while(1){
fflush(stdin);
c = PrintInstructions();
if (c == 'q' || c == 'Q')
break;
GetData(&time, &velocity, &acceleration);
d = AccelerationDisplacement(time, velocity, acceleration);
PrintOutput(d, time, velocity, acceleration);
}
printf("Press any key to exit....");
getch();
return 0;
}
int PrintInstructions() {
char x;
printf("\n/************************************/\n");
printf("Welcome to performance calculator app\n");
printf("Please follow the instructions to provide input data for calculation.\n");
printf("If you are done using it, enter 'q' or 'Q' to quit the app.\n");
printf("Do you want to proceed with the app? ");
scanf(" %c", &x); //Whitespace before %c is necessary to eat any remainng whitespace in stream
return x;
}
void GetData(float *time, float* velocity, float *acceleration) {
printf("Enter time(in sec): ");
scanf("%f", time);
printf("Enter velocity(in m/s): ");
scanf("%f", velocity);
printf("Enter acceleration(in m/s^2): ");
scanf("%f", acceleration);
}
double AccelerationDisplacement(float time, float velocity, float acceleration) {
return velocity*time + 0.5*acceleration*time*time;
}
void PrintOutput(double d, float time, float velocity, float acceleration) {
printf("Time(s): %f Velocity(m/s): %f Acceleration(m/s^2): %f Distance(m): %lf\n", time, velocity, acceleration, d);
}

Using C programming Description: You have been tasked to design an application for an engineering...
Using MATLAB. As an engineer working on designing and modelling a new drone product, you are doing a lot of different physics calculations. Your boss wants to write a program that can choose from an assortment of calculations and perform the desired physics calculation in order to streamline the design and modelling process. For this project you will write a function called PhysicsCalc. inputs Your function should take three inputs in the following order: var1–The first number in the calculation...
MAT LAB: write a program that can choose from an assortment of calculations and perform the desired physics calculation in order to streamline the design and modelling process. Your function should take three inputs in the following order: var1 – The first number in the calculation you want to perform. var2 – The second number in the calculation you want to perform var3 – The third number in the calculation you want to perform indicator . A variable, that has...
In this program, you will be using C++ programming constructs, such as functions. main.cpp Write a program that asks the user to enter an integer value. Your program will then display that integer back to the user. Your program should include a function called getInteger that requests an integer value from the user and returns that value back to the caller. Your main () function will call the function getInteger and will then display the value returned by that function....
i want the code and the answer to last image question#4
please
By the way, we need to print values for velocity, acclaration,
mass, all of the values
This program will prompt the user for the following input The distance an object traveled from point 1 to point 2 (variable distance) The time required to travel distance (variable time) The object's initial velocity (variable initVelocity) . The mass of the object (variable mass) You will need to write a series...
Using C programming For this project, you have been tasked to read a text file with student grades and perform several operations with them. First, you must read the file, loading the student records. Each record (line) contains the student’s identification number and then four of the student’s numerical test grades. Your application should find the average of the four grades and insert them into the same array as the id number and four grades. I suggest using a 5th...
c++ if you answer the question please write it line by
line and not in paragrapth form.
Write a C++ program that uses a structure named Movie to store the following. a. Title b. Director c. Year Released d. Running time (in minutes) e. Cost of production f. Revenue (first year). Create an array of type Movie of size 3. In your main program should then have in a loop (3 times) called a function called getData() and the purpose...
IN C PROGRAMMING, NOT C++ Rewrite the program you submitted for A8 to use pointers, pointer notation and arithmetic, etc. as follows: If you did not complete A8, you will need to start with those instructions, and then, change your code based on the instructions here The main() function should: Create a fixed or dynamic array, e.g., double grade[SIZE] or double *grade = malloc(...) or calloc(...) Concerning the function call for getData(), pass the address of the array and its...
PYTHON HOMEWORK When an object is falling because of gravity, the following formula can be used ot determine the distance the object falls during a specific time period: d=1/2 g t^2 The variables in the formula are as follows: d is the distance in meters(m), g is the acceleration due to gravity, an and its value is 9.8 m/s^2, t is the time duration in seconds(s). Write a function named falling_distance() that accepts an object's falling duration(time) in seconds as...
C++ LANGUAGE
The following formula can be used to determine the distance an
object falls in a specific time period:
d = 1 2 g t 2
where d is the distance in meters, g is 9.8, and t is the amount
of time, in seconds, the object has been falling.
Write a function named fallingDistance that accepts an
object's falling time in seconds as an argument. You must
define a named constant for g using a meaningful name and...
You have been assigned to design a package moving system as
shown in the figure. Boxes start at the top of the ramp with some
initial velocity. They slide down a nearly frictionless part of the
ramp and then are stopped due to friction on the horizontal part of
the ramp. The ramp has a height of h = 2.0 m, the initial velocity
of the boxes is vi = 2.4 m/s, and the distance the box
should travel before...