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
Asked Nov 9, 2019
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

Expert Answer

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:

//Declare header file

#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:

help_outline

Image Transcriptionclose

//Declare header file #include <iostream> //Declare namespace using namespace std; //Define main ) function int main () //Declare the necessary variables double total PayrollBefore = 0; double totalPayrollAfter double salary = 0; //Prompt the user to enter payroll details for 100 employees cout<<"Enter the payroll details of 100 employees: "<endl

fullscreen
Step 2

Screenshot of program #2:

help_outline

Image Transcriptionclose

//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 <" "<<endl; cout<<"Current salary for faculty <(i) //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

fullscreen
Step 3

Screenshot of program #3...

help_outline

Image Transcriptionclose

//Calculate total payroll before salary raised total Payroll Be fore salary = //Calculate total payroll after salary raised totalPayrollAfter = increasedSalary /Print the total payroll before salary raised cout<<"Total faculty payroll before pay raise is: < totalPayrollBe fore<<endl //Print the total payroll after salary raised cout<<"Total faculty payroll after pay raise is: <<totalPayrollAfter; return 0 }

fullscreen

Want to see the full answer?

See Solution

Check out a sample Q&A here.

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

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you
Show more Q&A
add
question_answer

Q: Use the Design Recipe to write a function num_negatives that consumes a list-type argument and retur...

A: Program:""" the below program returns the number of negativeintegers in the list.The list may have a...

question_answer

Q: Consider the sender A transmits 12 data packets to B using stop wait 3rd packet is lost while transm...

A: In stop wait protocol, both the sender and receiver have a windows size of one. The lost packets in ...

question_answer

Q: Describe some factors that increase computer efficiency. For example, increasing the number of CPU p...

A: A computer’s speed and performance are based on how good the hardware and software are working toget...

question_answer

Q: WHAT ARE THE ADVANTAGES DUE TO PRATICAL USES OF CRYPTOCURRENCY?

A: In the last couple of years, cryptocurrency has grown tremendously as people are using this alternat...

question_answer

Q: Suppose you want to build a program using WebGL that draws two kinds of objects - shiny billiard bal...

A: Drawing multiple objects in WebGLIn order to draw two kinds of objects in WebGL, first call function...

question_answer

Q: If originally x = 4, y = 0, and z = 2, which is the value of x, y and z after executing the followin...

A: Code(in Java)-class Main{            public static void main(String[] args)            {            ...

question_answer

Q: How many lines does his algorithm print? Write a recurrence and solve it.function printaton(n: an in...

A: The given program splits into three subprograms with half of the input size each and then prints n^4...

question_answer

Q: WHAT IS BLOCKCHAIN?

A: DefinitionBlockchain is a novel technology of today’s era. Blockchain is basically a growing list of...

question_answer

Q: DISCUSS THE ISSUES RELATED TO DIGITAL CASH TRANSACTIONS?

A: Digital cash:Financial transactions will become more efficient with digital cash, which in turn will...