Employee Raise Program in C++
###### Posted by Samath
Last Updated: November 03, 2014

A program uses a char variable named department and two double variables named salary and raise. The department variable contains one of the following letters (entered in either uppercase or lowercase): A, B, or C. Employees in departments A and B will receive a 2% raise. Employees in department C will receive a 1.5% raise. Write a C++ program to calculate and display the appropriate raise amount. Display the raise amount in fixed-point notation with two decimal places.

Here is the Solution to the problem above:

```#include <iomanip>
#include <iostream>

using namespace std;
int main(int argc, char *argv[])
{
char department;
double salary;
double raise;

cout<<"Enter the employee's department: ";
cin>>department;
cout<<"Enter the employee's salery: ";
cin>>salary;

if(department == 'A'||department == 'a')
{
raise = salary/100*2;
}
else if(department == 'B'||department == 'b')
{
raise = salary/100*2;
}
else if(department == 'C'||department == 'c')
{
raise = salary/100*1.5;
}

cout<<"Employee's pay raise by: ";
cout << setprecision(2) << fixed << raise;
return 0;
}
```
###### C program to enter basic salary of an employee and calculate gross salary
Samath | Jan 02, 2017
###### How can you find the second highest salary from an employee table?
RoseHrs | Jun 01, 2024
###### How do you use the POWER function to raise a number to a specified power?
FrankMl | Jul 17, 2024
###### How do you use the THROW statement to raise an exception in SQL Server?
NickCrt | Jun 18, 2024
###### How do you use the THROW statement to raise an error and terminate a batch?
QuinnLw | Jun 07, 2024