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

consider the definiton of the function main: int main () { int x, y; char z; dou

ID: 3618507 • Letter: C

Question

consider the definiton of the function main: int main () {    int x, y;    char z;    double rate, hours;    double amount;    .    .    . } the variables x,y,z rate and hours referred to in items as athrough f below are the variables of the function main. Each of thefunctions described must have the appropriate parameters to accessthese variables. Wrtie the following definitions. a. write the definition of the function initialize thatinitializes x and y to 0, and z to the blank character. b. write the definition of the function getHoursRate thatprompts the user to input the hours worked and rate per hour toinitialize the variables hours and rate of the function main. c. write the definition of the value-returning functionpaycheck that calculates and returns the amount to be paid to anemployee based on the hours worked and rate per hour. The hoursworked and rate per hour are stored in the variables hours andrate, respectively, of the function main. The formula forcalculating the amount to be paid is as follows: For the first 40hours, the rate is given rate; for hours over 40, the rate is 1.5times the given rate. d. Write the definition of the function printCheck that printsthe hours worked, rate per hour, and the amount due. e. Write the definition of the function funcOne that promptsthe user to input a number. The function then changes the value ofx by assigning input a number. The function then changes the valueof x by assigning the value of the expression 2 times the (old)value of x plus the value of y minus the value entered by theuser. f. Write the definition of the function nextChar that sets thevalue of z to the next character stored in z. g. Write a definition of a function main that tests each ofthese functions. consider the definiton of the function main: int main () {    int x, y;    char z;    double rate, hours;    double amount;    .    .    . } the variables x,y,z rate and hours referred to in items as athrough f below are the variables of the function main. Each of thefunctions described must have the appropriate parameters to accessthese variables. Wrtie the following definitions. a. write the definition of the function initialize thatinitializes x and y to 0, and z to the blank character. b. write the definition of the function getHoursRate thatprompts the user to input the hours worked and rate per hour toinitialize the variables hours and rate of the function main. c. write the definition of the value-returning functionpaycheck that calculates and returns the amount to be paid to anemployee based on the hours worked and rate per hour. The hoursworked and rate per hour are stored in the variables hours andrate, respectively, of the function main. The formula forcalculating the amount to be paid is as follows: For the first 40hours, the rate is given rate; for hours over 40, the rate is 1.5times the given rate. d. Write the definition of the function printCheck that printsthe hours worked, rate per hour, and the amount due. e. Write the definition of the function funcOne that promptsthe user to input a number. The function then changes the value ofx by assigning input a number. The function then changes the valueof x by assigning the value of the expression 2 times the (old)value of x plus the value of y minus the value entered by theuser. f. Write the definition of the function nextChar that sets thevalue of z to the next character stored in z. g. Write a definition of a function main that tests each ofthese functions.

Explanation / Answer

please rate - thanks #include using namespace std; void init(int&,int&,char&); void getHoursRate(double&,double&); double payCheck(double,double); void printCheck(double,double,double); void funcOne(int&,int); void nextChar(char&); int main() {int x, y; char z; double rate,hours; double salary; init(x,y,z); getHoursRate(hours, rate); salary=payCheck(hours, rate); printCheck(hours, rate,salary); cout