Write the program with at least two functions to solve the
following problem. The members of the board of a small
university are considering voting for a pay increase for
their 5 faculty members. They are considering a pay
increase of 8%. Write a program that will prompt for and
accept the current salary for each of the faculty members,
then calculate and display their individual pay increases.

At the end of the program, print the total faculty payroll
before and after the pay increase, and the total pay
increase involved.


Answer Posted / sammy

#include <stdio.h>
#include <stdlib.h>
double getIncrease (double curSal);

int main (void)
{
double CurrentSal[3];
double payIncreases[3];

for(int i=0; i<3; i++)
{
printf("Enter the salary for employee %d: $", i+1);
scanf("%d", &CurrentSal);
}

for (int j=0; j<3; j++)
{
payIncreases[j] = getIncrease(CurrentSal[j]);
printf("The pay increase for employee %d is $%d\n",j+1,
payIncreases[j]);
}
system ("pause");
return 0;
}
double getIncrease (double curSal)
{
double PayIncrease;
PayIncrease = curSal*.08;

return PayIncrease;
}

Is This Answer Correct ?    1 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the features of c language?

600


Can you please compare array with pointer?

593


What's the right way to use errno?

598


What are the types of pointers?

569


Explain what is meant by 'bit masking'?

620






explain how do you use macro?

639


Explain do array subscripts always start with zero?

728


What does char * * argv mean in c?

603


What is the advantage of an array over individual variables?

708


write a c program in such a way that if we enter the today date the output should be next day's date.

1660


What is the use of pragma in embedded c?

569


What is break in c?

560


Which header file is essential for using strcmp function?

908


What is the significance of an algorithm to C programming?

576


How can you restore a redirected standard stream?

585