write the function void get_emp_rec(int &id, double &prate, double &hours) that reads an employee's id number, pay rate and number of hours with an appropriate message. It returns the ID, pay rate, and the number of hours using the reference parameters id, prate, and hours, respectively.
You cannot return an expression from a function with return type void.
Your code looks alright, just remove the return statement since you are using references. Also please remove usingnamespace std; from your global scope. If you really have to, put it in your function's scope.
However, it's still up to you to make "an appropriate message".
You're effectively already doing that. When you modify a reference, you also modify the variable it's referencing.
Example :
1 2 3 4 5 6 7 8
int main() {
int var = 10;
int& ref = var; // reference of var
ref = 20; // var is now 20.
return 0;
}
What your instructor/book meant to say is something around the lines of : "It should take three references as parameters to allow the user to modify their values".