Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Due to my lack of computer skills, I have found it a difficult in understanding

ID: 3654878 • Letter: D

Question



Due to my lack of computer skills, I have found it a difficult in understanding and creating this program (successfully). Please teach me, in a series of steps, on how to create this function correctly and successfully, so that it will compile smoothly without resulting in technical errors (It would help greatly if you could post a picture of your work and the successful compiling of the function program). Again, if you do not know how to program, or answer my inquiry with a program that doesn't work at all, then I won't give any points. I want to learn what you can teach me, so please assist me to your best ability. Thank you.

B

Explanation / Answer

#include<stdio.h>

long int inp_salary()

{ printf("Enter the salary of the current employee");

long int n;

scanf("%d",&n);

return n;

}

void raises(long int salary)

{ double r=0;

if(salary >0 && salary<=30000)

r=0.07;

else

if(salary >30000 && salary<=40000)

r=0.055;

else

if(salary >40000)

r=0.04;

else

printf("Invalid data");

double raise = r*salary;

double tot_salary = salary + raise;

display(salary,raise,tot_salary); // calling the function

}

void display(salary,raise,tot_salary)

{ printf("Original salary Raise Total current salary ");

printf("%d %f %f",salary,raise,tot_salary);

}

main()

{ long int sal=inp_salary();

raises(salary);

}