Menu

[Solved] C Program Please Modify Code Grid Needed Allow User Input Name Arrays Include Double Totsa Q37291610

C program– please modify my code.

(No grid needed but it have to allow the user to inputtheir name)

(No arrays)

Write a C program to calculate salary raise for employees If salary is between If salary is between If salary is greater than

#include

double totSal, totRaise, totNewSal;

int main()

{

funcIp();

printf (“n Total: %li %li %li “, totSal, totRaise,totNewSal);

return 0;

}

float funcCalcRaise(double sal)
{
    float rate;

    double raise, newSal;

    if ( ( 0 < sal ) && ( sal <30000 ) ) rate = 0.07;

    if ( ( 30000 <= sal ) && ( sal<= 40000 ) ) rate = 0.055;

    if ( sal > 40000 ) rate = 0.04;

    newSal = sal + sal * rate;

    raise = sal * rate;

    totRaise = totRaise + raise;

    totNewSal = totNewSal + newSal;

    printf(“n Salary: %lf”, sal);
    printf(“n Rate%: %f”,rate);
    printf(“n Raise: %lf”,raise);
    printf(“n New Salary: %lf”,newSal);

    return rate;

}

void funcIp()
{

    double sal;

    float rate;

    int cnt = 1;

    while (cnt>0)
    {

    printf(“n Enter Salary: “);

    scanf (“%lf”, &sal);

    totSal = totSal + sal;

    rate = funcCalcRaise(sal);

    printf(“n Like to Continue? (1 = yes, 0 = no) “);

    scanf (“%d”, &cnt);

    }

}

Write a C program to calculate salary raise for employees If salary is between If salary is between If salary is greater than $ 0 < $ 30000 the rate is 7.0% $ 30000 <-$ 40000 the rate is 5.5% $40000 the rate is 4.0% You are to use appropriate functions and pass parameters for this program. Please include at least one function that uses the return statement and at least one function that does not use the return statement. Draw a structure chart that shows all the functions. (do not submit) Write a function to allow user to input the salaries. Write a function to calculate the raises, the total of the original salaries, the total of raises and the total of all the new salaries with the raises Write a function to print the output as following example below in a grid or similar to HW3 PS1 (formatting required but the grid lines not necessary) You may have more than the 3 functions mentioned in item 3,4,5 Use loop in main to repeat salary for each employee. 2. 3. 4 5 6 7. Calculation of Salary Raises Rate % EmploveeSalar New Salar Raise 1,750.00 1,650.00 1,925.00 2,200.00 1,600.04 1,800.00 $10,925.04 John Doe Bill Knott Bett Mann King Kon Mister Ed GomerPyle45,000.00 Total 25,000.00 30,000.00 35,000.00 40,000.00 40,001.00 7.00 5.50 5.50 5.50 4.00 4.00 26,750.00 31,650.00 36,925.00 42,200.00 41,601.04 46,800.00 $225,926.04 $215,001.00 Show transcribed image text Write a C program to calculate salary raise for employees If salary is between If salary is between If salary is greater than $ 0

Expert Answer


Answer to C program– please modify my code. (No grid needed but it have to allow the user to input their name) (No arrays) #inclu… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *