Question
Question 18 What is the output of the following program segment? int main() { float hours = 8; float payRate = 5.5; // per hour
Question 18
What is the output of the following program segment? int main() { float hours = 8; float payRate = 5.5; // per hour float 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; } 44 Gross Pay is 44 Gross Pay is gPay All of the above
-------------------------------------------------------------- Question 19
Assume a program uses the statement name = getFirstName(); to call the getFirstName function. (name is a string variable). Which of the following is a valid function header for the getFirstName function? void getFirstName(string firstName) string getFirstName(string firstName) string getFirstName() void getFirstName()
-------------------------------------------------------------- Question 20
How many parameters does the function calcGrossPay require? int main() { float hours = 8; float payRate = 5.5; // per hour float 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; } 0 parameters 1 parameter 2 parameter 3 parameter
-------------------------------------------------------------- Question 21
The cout<< sales[0] + sales[1]; statement will __________. Use the following 5 element array, named sales, to answer this question.
10000 12000 900 500 20000
display 22000 display 10000 + 12000 display sales[0] + sales[1] result in an error
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started