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
What is adt in c programming?
Why is void main used?
How to throw some light on the b tree?
Explain about the functions strcat() and strcmp()?
How important is structure in life?
a c code by using memory allocation for add ,multiply of sprase matrixes
Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)
What is the difference between union and anonymous union?
Tell us bitwise shift operators?
What is difference between main and void main?
How do we print only part of a string in c?
Differentiate between static and dynamic modeling.
a character or group of characters that defines a register,or a part of storage a) memory b) byte c) address d) linear list
What is a pointer value and address in c?
.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }