63.4k views
4 votes
Given the mass of an airplane, the amount of forward force produced by its propellers, and the mass of the TWO gliders it is towing (airplane connected to first glider and the first glider is connected to the second glider), calculate the resulting tension on each cable connecting the aircraft and the acceleration of the glider. Vertical forces and air resistance are not considered. . Your program must accept input and produce output that matches exactly to the given executions. Note that the width modifier used for the tension values is calculated as the number of digits in the force input plus six. Example Execution #1 (eleven spaces after colon character for tension output): Enter mass of airplane (kg) -> 15000 Enter mass of glider #1 (kg) -> 5000 Enter mass of glider #2 (kg) -> 4500 Enter force produced by propellers (N) -> 75000 Acceleration: 3.06 m/s^2 -=-=-= Resulting tension on cable #1: Resulting tension on cable #2: 29081.63 Newtons 13775.51 Newtons

1 Answer

12 votes

Answer:

Follows are the code to this question:

#include <stdio.h>//header file

int main() //main method

{

int plane, g1, g2, f;//defining integer variables

float m,a,t1,t2; //defining float variables

printf("Enter mass of airplane (kg)-> ");//print message for input value

scanf("%d", &plane);//input value

printf("Enter mass of glider #1 (kg)-> ");//print message for input value

scanf("%d", &g1);//input value

printf("Enter mass of glider #2 (kg)-> ");//print message for input value

scanf("%d", &g2);//input value

printf("Enter force produced by propellers (N) -> ");//print message for input value

scanf("%d", &f);//input value

m= plane + g1 + g2;//use float variable m to calculate Mass

a=f/m;//use float variable a to calculate Acceleration

printf("\\Acceleration: %.2f m/s^2", a);

printf("\\-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");//use print method for design

t1 = (g1 + g2) * a;//using the t1 variable to calculate tensions

printf("\\Resulting tension on cable #1: %.2f Newtons", t1);//print tension value

t2 = g2 * a;//using the t1 variable to calculate tensions

printf("\\Resulting tension on cable #2: %.2f Newtons", t2);//print tension value

printf("\\-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-");//use print method for design

return 0;

}

Output:

Please find the attached file.

Step-by-step explanation:

In this code four integer variable "plane, g1, g2, and f" and four floating-point variables "m, a, t1, and t2" is declared, in which the integer variable is used for input the value from the user-end.

In the next step, the "m" variable is used, which adds the "plane, g1, and g2" integer value to calculate mass, and in the "a" variable it calculates the acceleration, and in the "t1 and t2" variable it calculates the tension and prints its value.

Given the mass of an airplane, the amount of forward force produced by its propellers-example-1
User Ajith Deivam
by
5.5k points