Can u guys help me to find errors of this programme!
#include<iostream>
#include<conio>
#include<string>
using namespace std;
string employeeName;
int employeeNumber;
double employeeSalary;
char employeeType;
class Employee{
private:
string employeeName;
int employeeNumber;
double employeeSalary;
string employeeType;
public:
void promotion(){
calc_salary('pr');
}
void demotion(){
calc_salary('de');
}
void calc_salary(char ch){
float salSalary,comSalary,hourSalary ;
if(ch=='pr'){
switch(employeeType[0]){
case 'S':
salSalary = (employeeSalary*125)/100;
break;
case 'C':
int sale,commission;
cout<<"Please Enter number of sales : ";
cin>>sale;
cout<<"Please Enter commission percentage : ";
cin>>commission;
comSalary = ((employeeSalary*115)/100 + sale*commission );
break;
case 'H':
int hour,hrate;
cout<<"Please Enter number of hours : ";
cin>>hour;
cout<<"Please Enter hour rate : ";
cin>>hrate;
hourSalary = (hour*(hrate*110)/100);
break;
}
}
else if(ch=='de'){
float salSalaryd,comSalaryd,hourSalary;
switch(employeeType[0]){
case 'S':
salSalaryd = (employeeSalary*85)/100;
break;
case 'C':
int sale,commission;
cout<<"Please Enter number of sales : ";
cin>>sale;
cout<<"Please Enter commission percentage : ";
cin>>commission;
comSalaryd = ((employeeSalary*90)/100 + sale*commission);
break;
case 'H':
int hour,hrate;
cout<<"Please Enter number of hours : ";
cin>>hour;
cout<<"Please Enter hour rate : ";
cin>>hrate;
hourSalary = (hour*(hrate*95)/100);
break;
}
}
}
void setName(string n){
employeeName = n;
}
void setNumber(int num){
employeeNumber = num;
}
void setSalary(double s){
employeeSalary = s;
}
void setType(string t){
employeeType = t;
}
string getName(){
return employeeName;
}
int getNumber(){
return employeeNumber;
}
double getSalary(){
return employeeSalary;
}
string getType(){
return employeeType;
}
}
void main(){
// string employeeName;
// int employeeNumber;
// double employeeSalary;
// char employeeType;
clrscr();
//creating object
Employee emp;
cout<<"\nPlease Enter Employee Name : ";
cin>>employeeName;
emp.setName(employeeName);
cout<<"\nPlease Enter Employee Number : ";
cin>>employeeNumber;
emp.setNumber(employeeNumber);
cout<<"\nPlease Enter Employee Salary : ";
cin>>employeeSalary;
emp.setSalary(employeeSalary);
cout<<"\nPlease Enter Employee Type ( Salaried = S , Commission = C , Hourly = H ) : ";
cin>>employeeType;
if(employeeType== 'S')
emp.setType("Salaried Employee");
else if(employeeType== 'C')
emp.setType("Commissioned Employee");
else if(employeeType== 'H')
emp.setType("Hourly Employee");
cout<<"\n\t*** Employee Details *** ";
cout<<"\n\nEmployee Name : "<<emp.getName();
cout<<"\nEmployee Number : "<<emp.getNumber();
cout<<"\nEmployee Salary before promotion or demotion : "<<emp.getSalary();
cout<<"\nEmployee Type : "<<emp.getType();
cout<<"\nEmployee Salary after promotion : ";
emp.promotion();
cout<<emp.getSalary();
cout<<"\nEmployee Salary after demotion : ";
emp.demotion();
cout<<emp.getSalary();
getch();
}