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

1. Express natural log of x raised to the y power: log e (x^y) a. log(x**y) b. l

ID: 3538681 • Letter: 1

Question

1. Express natural log of x raised to the y power: loge (x^y)


a. log(x**y)

b. log( pow(x,y) )

c. log10( pow(x,y) )

d. log(x^y)

e. ln(x*y)


2. What is the output of this line code, given the following definition?


// the function call

display(7, 3);


// definition of the function display()

void display (int x, int y)

{

cout << y << " and " << x;

}


a. 7 3

b. 3, and 7

c. 7 and 3

d. 3 7

e. 3 and 7


3. What is the value of num after the following code is executed, given the function definition that follows:


// code in main

float num = findIt (float (5.0, 2);


// function defintion

float findIt (float xx, int two)

{

xx = xx + two;

return (xx / two);

}


a. 3.0

b. 0.5

c. 3.5

d. 4.5

e. 2.5


4. What is the output of the following line of code, given the function definition that follows:


cout << calc (1, 2) + calc (2, 3); // code in main


int calc (int x, int y) // function definition

{

x = x + 1;

return x % y;


}


a. 23

b. 0

c. 2

d. 1

e. none of the above


5. Which of the following is a valid function prototype?


a. float some function();

b. void nothing;

c. void something();

d. double int( string name );

e. int (int thing);


6. The region in a program where a paticular name (like a variable name) is visible or can be referenced is called the name's ___________.


a. storage duration

b. durability

c. power

d. scope

e. range

Explanation / Answer

1. b. log( pow(x,y) )

2.   e. 3 and 7

3. c. 3.5

4.   c. 2

5. c. void something();

6.d. scope