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.




Write the program with at least two functions to solve the following problem. The members of the bo..

Answer / 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

More C Interview Questions

to convert a string without using decrement operater and string functions

1 Answers  


What is the difference between char array and char pointer?

0 Answers  


Write a code to generate divisors of an integer?

0 Answers   Ericsson,


2)#include<iostream.h> main() { printf("Hello World"); } the program prints Hello World without changing main() the o/p should be intialisation Hello World Desruct the changes should be a)iostream operator<<(iostream os, char*s) os<<'intialisation'<<(Hello World)<<Destruct b) c) d)none of the above

4 Answers   Siemens,


What is the difference between int main and void main in c?

0 Answers  






Why c is procedure oriented?

0 Answers  


What is array within structure?

0 Answers  


The % symbol has a special use in a printf statement. How would you place this character as part of the output on the screen?

0 Answers  


write a program to find out number of on bits in a number?

17 Answers   Huawei, Microsoft,


How can you convert integers to binary or hexadecimal?

0 Answers  


write a program to generate address labels using structures?

0 Answers   SJC,


What is pointers in c with example?

0 Answers  


Categories