In C++:The members of the board of a small university are considering voting for a pay increase for their 100 faculty members. They are considering a pay increase of 5%. 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.

Question
6 views

In C++:

The members of the board of a small university are considering voting for a pay increase for their 100 faculty members. They are considering a pay increase of 5%. 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.
check_circle

Step 1

A C++ program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases and print the total faculty payroll before and after the pay increase at the end of the program is as follows,

Program:

#include <iostream>

//Declare namespace

using namespace std;

//Define main() function

int main()

{

//Declare the necessary variables

double totalPayrollBefore = 0;

double totalPayrollAfter = 0;

double salary ;

//Prompt the user to enter payroll details for 100 employees

cout<<"Enter the payroll details of 100 employees: "<<endl;

//Create "for" loop to iterate for 100 employees

for (int i=1; i<=100; i++)

{

//Prompt the user to enter current salary for the faculty

cout<<"Current salary for faculty " <<(i) << "? : "<<endl;

//Get the current salary from the user

cin>>salary;

//Calcualte the salary raised

double increasedSalary = salary * 1.05;

//Print the salary after pay raise

cout<<"Faculty " << (i) <<" salary after pay raise is: "

<< increasedSalary<<endl;

//Calculate total payroll before salary raised

totalPayrollBefore += salary;

//Calculate total payroll after salary raised

totalPayrollAfter += increasedSalary;

}

//Print the total payroll before salary raised

cout<<"Total faculty payroll before pay raise is: "

<< totalPayrollBefore<<endl;

//Print the total payroll after salary raised

cout<<"Total faculty payroll after pay raise is: "

<<totalPayrollAfter;

return 0;

}

Screenshot of program #1:

Step 2

Screenshot of program #2:

Step 3

Screenshot of program #3...

Want to see the full answer?

See Solution

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in