Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

1. Suppose a program is supposed to produce the following output: X Y Most of the program is shown here: int main() { string str1

1. Suppose a program is supposed to produce the following output:

X

Y

Most of the program is shown here:

int main()

{

string str1 = X

string str2 = Y;

func(str1, str2);

cout<

cout<

}

1 ________________

{

string temp = str1;

str1 = str2;

str2 = temp;

}

Which of the options below contains the correct function header to insert at line 1 in the program shown above?

Group of answer choices

void func(string &str1, string str2)

void func(string &str1, string &str2)

void func(string str1, string str2)

void func(string str1, string &str2)

2. All of the following are valid ways a function can use a value returned to it EXCEPT:

Group of answer choices

Use the value returned in an expression

Assign the value returned to a variable

Send the value returned to a cout object

Send the value returned to a cin object

3. An argument passed to a reference variable must be a/an what?

Group of answer choices

Expression

Variable

Constant

Address

4. A function can give another function access to one of its variables by making the variable a _ variable.

Group of answer choices

static

local

global

reference

5. int sub(int num1, int num2, &num3)

{ return num1-num2-num3; }

num3 is passed by _

Group of answer choices

reference

parameter

value

pointer

6. Any global that you create should be a what?

Group of answer choices

Parameter

Variable

Constant

Reference

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

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students explore these related Databases questions