Ask Question
26 February, 12:41

What is the output of the following program segment? int main () {float hours = 8; float payRate = 5.5; / / per hourfloat grossPay = 0.0; grossPay = calcGrossPay (hours, payRate); displayGrossPay (grossPay); return 0; }float calcGrossPay (float hrs, float payRt) {return hrs * payRt; }void displayGrossPay (float gPay) {cout <<"Gross Pay is "<< gPay << endl; } a. 44b. Gross Pay is 44c. Gross Pay is gPayd. All of the above

+3
Answers (1)
  1. 26 February, 13:09
    0
    The answer is "Option b".

    Explanation:

    In the code firstly, the main method is declared, inside the main method three float variable is declared, that are "hours, payRate, and grossPay", in which all variable assign a value, that is "8, 5.5, and 0.0". The first two variables are used as parameters, and the third variable is used to hold and pass as a parameter in displayGrossPay function, Then two function is called that is "calcGrossPay and displayGrossPay".

    The calcGrossPay function uses "hours and payRate" variable as a parameter, and return multiplication of value. The displayGrossPay function uses a float variable "gPay" in its parameter, which is held in the grossPay variable, that holds calcGrossPay function value and print, its value.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “What is the output of the following program segment? int main () {float hours = 8; float payRate = 5.5; / / per hourfloat grossPay = 0.0; ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers