Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

How to make functions for #17,18, 20 and 21 ? giveRaise and giveRaiseToOneEmploy

ID: 3826947 • Letter: H

Question

How to make functions for #17,18, 20 and 21 ? giveRaise and giveRaiseToOneEmployee

17. Make a function called giveRaise. A raise percentage is passed to this function as one of the parameters and give the raise to everybody in the array. You will be passing either the male or female array to this function. 18. Call giveRaise in the main with the female array and 5.5 (5.5% raise) and then call printAllEmp to make sure all the female employees received a 5.5 raise. int mai giveRaise (5.5,?????????????); Expected output Agusta F 10.55 19569 Ada Emmylou Harris 35.34 72647

Explanation / Answer

Hi, Please find my implementation of both methods.

Please let me know in case of any issue.

void giveRaise(employee emp[], double per, int size){
  
   int i;
   for(i=1; i<size; i++){
      
       emp[i].amount = emp[i].amount + emp[i].amount*per/100.0;
   }
}

void giveRaise(employee emp, double per){
  
   emp.amount = emp.amount + emp.amount*per/100.0;
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote