Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Linked Data A Geographic Perspective

Authors: Glen Hart, Catherine Dolbear

1st Edition

1000218910, 9781000218916

More Books

Students also viewed these Databases questions

Question

6. Be able to choose and prepare a training site.

Answered: 1 week ago