Write the prototype of the function giveRaise() that has 2 parameters, raise and salary. The first specifies the percentage amount of the raise (i.e. 4.2 for a 4.2% raise). The second is a reference parameter that contains the current salary.
Write the function giveRaise() specified above. The function will update the salary parameter with the raise specified. The function will check to see that the raise amount is greater than 0 and less than 50. If it isn’t, the function will not modify the salary, and just return.
For example, if x is 10000, giveRaise(4.2, x) will change x to 10420.
Write a program that prompts the user for a salary and a raise percentage, calls giveRaise() then displays the new salary. For example, it should accept 20000 and 3, and display “The new salary is $20600.” The program should loop until the user enters a zero for either value.
Use the most appropriate data types. Do not use any global variables.
Don’t forget the function prototype.
There should be no cin’s or cout’s inside giveRaise ().