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 / 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 |
Write a programme using structure that create a record of students. The user allow to add a record and delete a record and also show the records in ascending order.
0 Answers Sikkim Manipal University,
Take an MxN matrice from user and then sum upper diagonal in a variable and lower diagonal in a separate variables. Print the result
List some of the dynamic data structures in C?
Discuss the function of conditional operator, size of operator and comma operator with examples.
What does 3 periods mean in texting?
In a header file whether functions are declared or defined?
Disadvantages of C language.
The differences between Windows XP and Windows Visa
Write a routine that prints out a 2-D array in spiral order!
What is the output of the below program and how it is? void main() { static int var=5; printf("%d",var--); if(var) main(); }
8 Answers MindFire, TCS, Tech Mahindra,
Derive the complexity expression for AVL tree?
What is the use of #define preprocessor in c?