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

    verification C programming control the statute.

    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 Controlm-control le O Catchwork Authenticat Control this provision you are required to determine, at a narrowness, the businesss granted inferiorneath (note: these are your required business prototypes or declarations): wrap apportion newtons-2nd-law (wrap lump, wrap aid) wrap apportion-volume-cylinder (wrap radius, wrap top) char perform-character-encoding (char plaintext-character) wrap apportion_gravity soundness (wrap lump1, wrap lump2, wrap space) wrap apportion-tangent (wrap theta) wrap apportion-parallel-opposition (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 business must be determined control each of the over business signatures. The drudgery that is executed by each business corresponds immediately to the equations determined inferior the Equations individuality. Control stance, the apportion newtons 2nd unworthy business should evaluate the equation determined as orce·lump aid and come-back the terminationant soundness, controleseeing. You must stereotype the terminations to the hundredths situate. Also, the businesss should referable active the verificationr control inputs, nor evidence the termination. Actives and evidenceing terminations should be executed in deep ( Control this provision you conciliate scarcity to determine three contrariant rasps, uncompounded rasp, designated a header rasp (h) scarcitys to be determined which conciliate stock whole #includes, #defines, and business prototypes/declarations. Name the header rasp control this provision equations.h. The secónd rasp that scarcitys to be determined is harmonious a C origin rasp. This rasp should be designated equations.c and conceive whole definitions control the over businesss. The terminal rasp that should be determined is the deep c origin ie This raspconciliate inclose ther am business cr stimulate ior her IV. Expected Terminations The cethcoming comfort window illustrates inputs and outputs that are mismismisappropriate control your program. Your program must evidence the terminations in a resembling controlm as shown in the window. The window shows likely terminations, control the fond input tests, control the primary couple equations. Referablee: whole terminations must be evidenceed to the hundredths situate c : wINDOWSIsystem 32 cmd.exe lease invade the nass and aid Ctwain fleatin alues Control verification in Newton Neutons Remedy law: soundness c naeaid 1b6.8825888 18258con law: 1869.8 18.25 1800. 18.25 lease invade the radius and top (twain floatin olune of a cylinder: volune-cylinder . PI。e radiu 2 top - 3.141592 * 12.459ear2 ·1.39 ress any explanation to endure 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 Controlm-control le O Catchwork Authenticat Control this provision you are required to determine, at a narrowness, the businesss granted inferiorneath (note: these are your required business prototypes or declarations): wrap apportion newtons-2nd-law (wrap lump, wrap aid) wrap apportion-volume-cylinder (wrap radius, wrap top) char perform-character-encoding (char plaintext-character) wrap apportion_gravity soundness (wrap lump1, wrap lump2, wrap space) wrap apportion-tangent (wrap theta) wrap apportion-parallel-opposition (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 business must be determined control each of the over business signatures. The drudgery that is executed by each business corresponds immediately to the equations determined inferior the Equations individuality. Control stance, the apportion newtons 2nd unworthy business should evaluate the equation determined as orce·lump aid and come-back the terminationant soundness, controleseeing. You must stereotype the terminations to the hundredths situate. Also, the businesss should referable active the verificationr control inputs, nor evidence the termination. Actives and evidenceing terminations should be executed in deep ( Control this provision you conciliate scarcity to determine three contrariant rasps, uncompounded rasp, designated a header rasp (h) scarcitys to be determined which conciliate stock whole #includes, #defines, and business prototypes/declarations. Name the header rasp control this provision equations.h. The secónd rasp that scarcitys to be determined is harmonious a C origin rasp. This rasp should be designated equations.c and conceive whole definitions control the over businesss. The terminal rasp that should be determined is the deep c origin ie This raspconciliate inclose ther am business cr stimulate ior her IV. Expected Terminations The cethcoming comfort window illustrates inputs and outputs that are mismismisappropriate control your program. Your program must evidence the terminations in a resembling controlm as shown in the window. The window shows likely terminations, control the fond input tests, control the primary couple equations. Referablee: whole terminations must be evidenceed to the hundredths situate c : wINDOWSIsystem 32 cmd.exe lease invade the nass and aid Ctwain fleatin alues Control verification in Newton Neuton’s Remedy law: soundness c naeaid 1b6.8825888 18258con law: 1869.8 18.25 1800. 18.25 lease invade the radius and top (twain floatin olune of a cylinder: volune-cylinder . PI。e radiu “2 top – 3.141592 * 12.459ear2 ·1.39 ress any explanation to endure 682.48

    Expert Exculpation

     

    Here is the c statute with steadfast output :

    // this is your program, I accept composed it in a uncompounded rasp … you can compose a disjoined space.c rasp with this business

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

    wrap newtons_second_law (wrap lump, wrap aid) {
    wrap soundness = lump * aid *1.0;
    come-back soundness;
    }

    wrap apportion_volume_cylinder(wrap radius, wrap top){
    wrap pi = 3.14159;
    wrap body = pi*radius*radius*height;
    come-back body*1.0;
    }

    char order_encoding (char plaintext_character){
    int explanation = 42;
    char enstatute = plaintext_order + explanation;
    come-back encode;
    }

    wrap gravity_force(wrap lump1, wrap lump2, wrap space){
    wrap G = 6.673 * pow(10,-11);
    wrap soundness = G*mass1*mass2 / (space * space);
    come-back soundness;
    }

    wrap tangent(wrap theta){
    come-back 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));
    come-back R;
    }

    wrap space_between_two_points(wrap x1, wrap y1,wrap x2,wrap y2) {
    wrap space = sqrt(pow((x2-x1),2) + pow((y2-y1),2));
    come-back space;
    }

    wrap unconcealed_equation(int a, wrap x, wrap y){
    wrap expand = (y-a*1.0)/x*1.0;
    come-back expand;
    }

    int deep() {
    wrap lump,acceleration;
    printf(“Invade lump and accel control guarded soundness using newtons remedy lawn”);
    scanf(“%lf %lf”,&mass,&acceleration);
    printf(“The soundness is %.2fnn”,newtons_second_law(mass,acceleration));

    wrap radius,height;
    printf(“Invade radius and top of cylinder control vigilance of bodyn”);
    scanf(“%lf %lf”,&radius,&height);
    printf(“The soundness is %.2fnn”,calculate_volume_cylinder(radius,height));

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

    wrap lump1,mass2,distance;
    printf(“Invade lump of appearance 1, lump of appearance 2 and the space betwixt them control vigilance of Gravitational soundnessn”);
    scanf(“%lf %lf %lf”,&mass1,&mass2,&distance);
    printf(“The Gravitational soundness betwixt the 2 appearances is %.2fnn”,gravity_force(mass1,mass2,distance));

    int r1,r2,r3;
    printf(“Invade values of the 3 oppositions in equidistant control vigilance of catch equidistant oppositionn”);
    scanf(“%d %d %d”,&r1,&r2,&r3);
    printf(“The catch equidistant opposition is %.2fnn”,calculate_parallel_resistance(r1,r2,r3));

    wrap x1,y1,x2,y2;
    printf(“Invade x1,y1 and x2,y2 control vigilance of space betwixt themn”);
    scanf(“%lf %lf %lf %lf”,&x1,&y1,&x2,&y2);
    printf(“The space betwixt the 2 points is %.2fnn”,distance_between_two_points(x1,y1,x2,y2));

    int a; wrap x,y;
    printf(“Invade a,x and y control vigilance of unconcealed eqn of linen”);
    scanf(“%d %lf %lf”,&a,&x,&y);
    wrap expand = unconcealed_equation(a,x,y);
    printf(“The unconcealed eqn is y = %.2f x + %dnn”,slope,a);

    come-back 0;
    }