int main()
{
int x, y;
char z;
double rate, hours;
double amount;.
}
The variables x, y, z, rate, and hours referred to in terms a through f below are the variables of the function main. Each of the functions described must have the appropriate parameters to access these variables.
a.Write the definition of the function initialize the initialize x and y to 0, and z to the blank character.
1 2 3 4 5 6
void initialize(int& one, int& two, char& ch)
{
one = 0;
two = 0;
ch = ' ';
}
b.Write the definition of the function getHoursRate that prompts the user to input the hours worked and rate per hour to initialize the variable hours and rate of the function main.
This really looks like some sort of homework question. No one is going to do your homework for you. See what you can do yourself then when your own code gives errors we'll help with that.
Your assignment is asking you to use the functions given in questions 'a' and 'b' but apply them to the variables x, y, z etc.
So just rewrite the functions using the variables from the question. Instead of initializing "one" to 0, initialize "x" to 0 etc.