Professional Documents
Culture Documents
C++ Groupe Projet (Mahsa) 2022
C++ Groupe Projet (Mahsa) 2022
C++ Groupe Projet (Mahsa) 2022
**********************************************************************************
*/
#include <iostream>
#include <string>
#include <iomanip>
//
//
class EmployeeClass
public:
void DisplayEmployInformation(void);
string EmployeefirstName,EmployeelastName;
int hours ;
float wage ;
float basepay ;
int overtime_hours ;
float overtime_pay ;
float overtime_extra ;
float iTotal_salaries ;
float iIndividualSalary ;
int iTotal_hours ;
int iTotal_OvertimeHours ;
};
int main()
cout << "\n%%%%%%%%%%%% Welcome to MAHSA Employee Over_time Pay Center %%%%%
%%%%%%%\n\n" ;
/*
We Use this section to define your objects. we will have one object per employee. we have only
three employees.
*/
EmployeeClass Emp1;
EmployeeClass Emp2;
EmployeeClass Emp3;
/*
Prompt the employee name, hours worked, and the hourly wage. For each piece of information,
we will update the appropriate class member defined above.
Example of Prompts
*/
/*
Prompt the employee name, hours worked, and the hourly wage. For each piece of information,
you will update the appropriate class member defined above.
*/
cin>> Emp2.EmployeelastName;
/*
Prompt the employee name, hours worked, and the hourly wage. For each piece of information,
you will update the appropriate class member defined above.
*/
cin>> Emp3.EmployeelastName;
/*
Here you will implement a function call to implement the employ calcuations for each object
defined above.
*/
Emp1.ImplementCalculations(Emp1.EmployeefirstName,Emp1.EmployeelastName, Emp1.hours,
Emp1.wage);
Emp2.ImplementCalculations(Emp2.EmployeefirstName,Emp2.EmployeelastName, Emp2.hours,
Emp2.wage);
Emp3.ImplementCalculations(Emp3.EmployeefirstName,Emp3.EmployeelastName, Emp3.hours,
Emp3.wage);
/*
This section you will send all three objects to a function that will add up the the following
information:
*/
EmployeeClass temp;
temp.Addsomethingup(Emp1,Emp2,Emp3);
return 0;
overtime_hours=0;
overtime_pay=0;
overtime_extra=0;
/*
This section is for the basic calculations for calculating overtime pay.
*/
basepay = 40 * wage;
overtime_hours = hours - 40;
/*
Implement function call to output the employee information. Function is defined below.
*/
DisplayEmployInformation();
else
/* Here you are going to calculate the hours less than 40 hours.
*/
iIndividualSalary = basepay;
/*
Implement function call to output the employee information. Function is defined below.
*/
DisplayEmployInformation();
void EmployeeClass::DisplayEmployInformation ()
*/
cout << "Employee Name .......... = " << EmployeefirstName << " "<< EmployeelastName << endl;
cout << "Base Pay .................. = " << setprecision(5)<<"RM"<< basepay << endl;
cout << "Hours in Overtime ......... = " << setprecision(4)<<"RM"<< overtime_hours << endl;
cout << "Overtime Pay Amount........ = " << setprecision(5)<<"RM"<< overtime_pay << endl;
cout << "Total Pay ................. = " << setprecision(5)<<"RM"<< iIndividualSalary << endl;
// function arguments and saves them as the calling object's data member values.
/*
*/
cout << "%%%% Total Employee Salaries ..... = " << setprecision(6)<<iTotal_salaries <<endl;
cout << "%%%% Total Employee Hours ........ = " << setprecision(5)<<iTotal_hours << endl;
cout << "%%%% Total Overtime Hours......... = " << setprecision(5)<<iTotal_OvertimeHours << endl;
} // End of function
HUSSEIN
ABDIRAHMAN
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%