I JUST NEED HELP ON THE WRITING THE FUNCTION PART.
write a function called calculatePay( ) which takes an employee as an argument and returns the amount of money they need to be paid this pay period. Employees should be paid "time and a half" for all hours over 40. You should set values for the employee's hours and payRate before sending it to the function.
double calculatePay(employee e)
double pay = e.hours * e.payRate;
//Employees should be paid "time and a half" for all hours over 40
//that can be read as «they have a .5 bonus»
constdouble work_limit = 40; //some day this will be reduced
double extra_hours = e.hours - work_limit;
if(extra_hours > 0)
pay += extra_hours * 0.5 * e.payRate;