Homework Solution: use C programming for the code….

    use C programming for the code.

    eecswsu.edu/-aofallon/cpts 121/progassignments/PA2htm DOO--) nertklocx d -u uasM bp D Moon Lovers Scale YouTube a litait: F nge Jal eal A lga탄 ial ao twichtv a Echelon Form-for le O Network Authenticat For this assignment you are required to define, at a minimum, the functions provided below (note: these are your required function prototypes or declarations): double calculate newtons-2nd-law (double mass, double acceleration) double calculate-volume-cylinder (double radius, double height) char perform-character-encoding (char plaintext-character) double calculate_gravity force (double mass1, double mass2, double distance) double calculate-tangent (double theta) double calculate-parallel-resistance (int r1, int r2, int r3) double calculate-distance-between-2pts (double x1, double y 1, double x2, double y2) double calculate-general-equation (int a, double x, double z) 釒 釒 钅 A function must be defined for each of the above function signatures. The task that is performed by each function corresponds directly to the equations defined under the Equations section. For example, the calculate newtons 2nd low function should evaluate the equation defined as orce·mass acceleration and return the resultant force, etc. You must print the results to the hundredths place. Also, the functions should not prompt the user for inputs, nor display the result. Prompts and displaying results should be performed in main ( For this assignment you will need to define three different files, one file, called a header file (h) needs to be defined which will store all #includes, #defines, and function prototypes/declarations. Name the header file for this assignment equations.h. The secónd file that needs to be defined is just a C source file. This file should be named equations.c and include all definitions for the above functions. The last file that should be defined is the main c source ie This filewill contain ther am function cr drive ior her IV. Expected Results The following console window illustrates inputs and outputs that are appropriate for your program. Your program must display the results in a similar form as shown in the window. The window shows possible results, for the given input tests, for the first two equations. Note: all results must be displayed to the hundredths place c : wINDOWSIsystem 32 cmd.exe lease enter the nass and acceleration Cboth fleatin alues For use in Newton Neutons Second law: force c naeacceleration 1b6.8825888 18258con law: 1869.8 18.25 1800. 18.25 lease enter the radius and height (both floatin olune of a cylinder: volune-cylinder . PI。e radiu 2 height - 3.141592 * 12.459ear2 ·1.39 ress any key to continue 682.48

    media%2Fe86%2Fe86b5b8e-e34f-4f5a-a47a-5c

    media%2F420%2F42027a85-6377-4db9-bdd0-94

    eecswsu.edu/-aofallon/cpts 121/progassignments/PA2htm DOO--) nertklocx d -u" uasM bp D Moon Lovers Scale YouTube a litait: F nge Jal eal A lga탄 ial ao twichtv a Echelon Form-for le O Network Authenticat For this assignment you are required to define, at a minimum, the functions provided below (note: these are your required function prototypes or declarations): double calculate newtons-2nd-law (double mass, double acceleration) double calculate-volume-cylinder (double radius, double height) char perform-character-encoding (char plaintext-character) double calculate_gravity force (double mass1, double mass2, double distance) double calculate-tangent (double theta) double calculate-parallel-resistance (int r1, int r2, int r3) double calculate-distance-between-2pts (double x1, double y 1, double x2, double y2) double calculate-general-equation (int a, double x, double z) 釒 釒 钅 A function must be defined for each of the above function signatures. The task that is performed by each function corresponds directly to the equations defined under the Equations section. For example, the calculate newtons 2nd low function should evaluate the equation defined as orce·mass acceleration and return the resultant force, etc. You must print the results to the hundredths place. Also, the functions should not prompt the user for inputs, nor display the result. Prompts and displaying results should be performed in main ( For this assignment you will need to define three different files, one file, called a header file (h) needs to be defined which will store all #includes, #defines, and function prototypes/declarations. Name the header file for this assignment equations.h. The secónd file that needs to be defined is just a C source file. This file should be named equations.c and include all definitions for the above functions. The last file that should be defined is the main c source ie This filewill contain ther am function cr drive ior her IV. Expected Results The following console window illustrates inputs and outputs that are appropriate for your program. Your program must display the results in a similar form as shown in the window. The window shows possible results, for the given input tests, for the first two equations. Note: all results must be displayed to the hundredths place c : wINDOWSIsystem 32 cmd.exe lease enter the nass and acceleration Cboth fleatin alues For use in Newton Neuton's Second law: force c naeacceleration 1b6.8825888 18258con law: 1869.8 18.25 1800. 18.25 lease enter the radius and height (both floatin olune of a cylinder: volune-cylinder . PI。e radiu "2 height - 3.141592 * 12.459ear2 ·1.39 ress any key to continue 682.48

    Expert Answer

     
    Here is the c code with attached output : // this is your program, I have created it in a single file ... you can cre

    conservation C programming ce the adjudication.

    eecswsu.edu/-aofallon/cpts 121/progassignments/PA2htm DOO--) nertklocx d -u uasM bp D Moon Lovers Scale YouTube a litait: F nge Jal eal A lga탄 ial ao twichtv a Echelon Cem-ce le O Entoilwork Authenticat Ce this enactment you are required to settle, at a insufficiency, the administrations supposing beunworthy (note: these are your required administration prototypes or declarations): wrap apportion newtons-2nd-law (wrap concretion, wrap succor) wrap apportion-volume-cylinder (wrap radius, wrap apex) char perform-character-encoding (char plaintext-character) wrap apportion_gravity cece (wrap concretion1, wrap concretion2, wrap interspace) wrap apportion-tangent (wrap theta) wrap apportion-parallel-hindrance (int r1, int r2, int r3) wrap apportion-distance-between-2pts (wrap x1, wrap y 1, wrap x2, wrap y2) wrap apportion-general-equation (int a, wrap x, wrap z) 釒 釒 钅 A administration must be settled ce each of the aloft administration signatures. The underneathneathtaking that is produced by each administration corresponds instantly to the equations settled beunworthy the Equations minority. Ce development, the apportion newtons 2nd unworthy administration should evaluate the equation settled as orce·concretion succor and retaliate the unimportant cece, anticipation. You must imimprint the remainders to the hundredths attribute. Also, the administrations should referable attributable attributable attributable apt the conservationr ce inputs, nor ostentation the remainder. Apts and ostentationing remainders should be produced in ocean ( Ce this enactment you earn demand to settle three unanalogous rasps, undivided rasp, designated a header rasp (h) demands to be settled which earn supply full #includes, #defines, and administration prototypes/declarations. Name the header rasp ce this enactment equations.h. The secónd rasp that demands to be settled is fitting a C caconservation rasp. This rasp should be denominated equations.c and apprehend full definitions ce the aloft administrations. The latest rasp that should be settled is the ocean c caconservation ie This raspearn comprehend ther am administration cr propel ior her IV. Expected Remainders The aftercited relieve window illustrates inputs and outputs that are embezzle ce your program. Your program must ostentation the remainders in a common cem as shown in the window. The window shows feasible remainders, ce the stable input tests, ce the principal brace equations. Referable attributable attributablee: full remainders must be ostentationed to the hundredths attribute c : wINDOWSIsystem 32 cmd.exe lease invade the nass and succor Ctwain fleatin alues Ce conservation in Newton Neutons Remedy law: cece c naesuccor 1b6.8825888 18258con law: 1869.8 18.25 1800. 18.25 lease invade the radius and apex (twain floatin olune of a cylinder: volune-cylinder . PI。e radiu 2 apex - 3.141592 * 12.459ear2 ·1.39 ress any guide to live 682.48

    media%2Fe86%2Fe86b5b8e-e34f-4f5a-a47a-5c

    media%2F420%2F42027a85-6377-4db9-bdd0-94

    eecswsu.edu/-aofallon/cpts 121/progassignments/PA2htm DOO–) nertklocx d -u” uasM bp D Moon Lovers Scale YouTube a litait: F nge Jal eal A lga탄 ial ao twichtv a Echelon Cem-ce le O Entoilwork Authenticat Ce this enactment you are required to settle, at a insufficiency, the administrations supposing beunworthy (note: these are your required administration prototypes or declarations): wrap apportion newtons-2nd-law (wrap concretion, wrap succor) wrap apportion-volume-cylinder (wrap radius, wrap apex) char perform-character-encoding (char plaintext-character) wrap apportion_gravity cece (wrap concretion1, wrap concretion2, wrap interspace) wrap apportion-tangent (wrap theta) wrap apportion-parallel-hindrance (int r1, int r2, int r3) wrap apportion-distance-between-2pts (wrap x1, wrap y 1, wrap x2, wrap y2) wrap apportion-general-equation (int a, wrap x, wrap z) 釒 釒 钅 A administration must be settled ce each of the aloft administration signatures. The underneathneathtaking that is produced by each administration corresponds instantly to the equations settled beunworthy the Equations minority. Ce development, the apportion newtons 2nd unworthy administration should evaluate the equation settled as orce·concretion succor and retaliate the unimportant cece, anticipation. You must imimprint the remainders to the hundredths attribute. Also, the administrations should referable attributable attributable attributable apt the conservationr ce inputs, nor ostentation the remainder. Apts and ostentationing remainders should be produced in ocean ( Ce this enactment you earn demand to settle three unanalogous rasps, undivided rasp, designated a header rasp (h) demands to be settled which earn supply full #includes, #defines, and administration prototypes/declarations. Name the header rasp ce this enactment equations.h. The secónd rasp that demands to be settled is fitting a C caconservation rasp. This rasp should be denominated equations.c and apprehend full definitions ce the aloft administrations. The latest rasp that should be settled is the ocean c caconservation ie This raspearn comprehend ther am administration cr propel ior her IV. Expected Remainders The aftercited relieve window illustrates inputs and outputs that are embezzle ce your program. Your program must ostentation the remainders in a common cem as shown in the window. The window shows feasible remainders, ce the stable input tests, ce the principal brace equations. Referable attributable attributablee: full remainders must be ostentationed to the hundredths attribute c : wINDOWSIsystem 32 cmd.exe lease invade the nass and succor Ctwain fleatin alues Ce conservation in Newton Neuton’s Remedy law: cece c naesuccor 1b6.8825888 18258con law: 1869.8 18.25 1800. 18.25 lease invade the radius and apex (twain floatin olune of a cylinder: volune-cylinder . PI。e radiu “2 apex – 3.141592 * 12.459ear2 ·1.39 ress any guide to live 682.48

    Expert Solution

     

    Here is the c adjudication with stable output :

    // this is your program, I keep begetd it in a uncompounded rasp … you can beget a different interspace.c rasp with this administration

    #apprehend <stdio.h>
    #apprehend <stdlib.h>
    #apprehend <time.h>
    #apprehend <math.h>

    wrap newtons_second_law (wrap concretion, wrap succor) {
    wrap cece = concretion * succor *1.0;
    retaliate cece;
    }

    wrap apportion_volume_cylinder(wrap radius, wrap apex){
    wrap pi = 3.14159;
    wrap dimensions = pi*radius*radius*height;
    retaliate dimensions*1.0;
    }

    char sign_encoding (char plaintext_character){
    int guide = 42;
    char enadjudication = plaintext_sign + guide;
    retaliate encode;
    }

    wrap gravity_force(wrap concretion1, wrap concretion2, wrap interspace){
    wrap G = 6.673 * pow(10,-11);
    wrap cece = G*mass1*mass2 / (interspace * interspace);
    retaliate cece;
    }

    wrap tangent(wrap theta){
    retaliate tangent(theta);
    }

    wrap apportion_parallel_resistance(int r1,int r2,int r3){

    wrap R = 1.0 / ( (1.0/r1) + (1.0/r2) + (1.0/r3));
    retaliate R;
    }

    wrap interspace_between_two_points(wrap x1, wrap y1,wrap x2,wrap y2) {
    wrap interspace = sqrt(pow((x2-x1),2) + pow((y2-y1),2));
    retaliate interspace;
    }

    wrap open_equation(int a, wrap x, wrap y){
    wrap mount = (y-a*1.0)/x*1.0;
    retaliate mount;
    }

    int ocean() {
    wrap concretion,acceleration;
    printf(“Invade concretion and accel ce cautious cece using newtons remedy lawn”);
    scanf(“%lf %lf”,&mass,&acceleration);
    printf(“The cece is %.2fnn”,newtons_second_law(mass,acceleration));

    wrap radius,height;
    printf(“Invade radius and apex of cylinder ce balance of dimensionsn”);
    scanf(“%lf %lf”,&radius,&height);
    printf(“The cece is %.2fnn”,calculate_volume_cylinder(radius,height));

    char ch;
    printf(“Invade sign to be encodedn”);
    scanf(” %c”,&ch);
    printf(“The encoded sign is %cnn”,character_encoding(ch));

    wrap concretion1,mass2,distance;
    printf(“Invade concretion of end 1, concretion of end 2 and the interspace among them ce balance of Gravitational cecen”);
    scanf(“%lf %lf %lf”,&mass1,&mass2,&distance);
    printf(“The Gravitational cece among the 2 ends is %.2fnn”,gravity_force(mass1,mass2,distance));

    int r1,r2,r3;
    printf(“Invade values of the 3 hindrances in analogous ce balance of entoil analogous hindrancen”);
    scanf(“%d %d %d”,&r1,&r2,&r3);
    printf(“The entoil analogous hindrance is %.2fnn”,calculate_parallel_resistance(r1,r2,r3));

    wrap x1,y1,x2,y2;
    printf(“Invade x1,y1 and x2,y2 ce balance of interspace among themn”);
    scanf(“%lf %lf %lf %lf”,&x1,&y1,&x2,&y2);
    printf(“The interspace among the 2 points is %.2fnn”,distance_between_two_points(x1,y1,x2,y2));

    int a; wrap x,y;
    printf(“Invade a,x and y ce balance of open eqn of linen”);
    scanf(“%d %lf %lf”,&a,&x,&y);
    wrap mount = open_equation(a,x,y);
    printf(“The open eqn is y = %.2f x + %dnn”,slope,a);

    retaliate 0;
    }