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

4.6 Consider the code on page 3. Suppose at runtime the user enters 19 for x and

ID: 3529235 • Letter: 4

Question

4.6 Consider the code on page 3. Suppose at runtime the user enters 19 for x and 6 for y. (a) What would be the output? (b) In Line 4 of main() the right hand side of the assignment operator is a(n) ___ ___ (2 words) which ___ function f() to execute it. (c) In Line 4 of main(), the x and y parameters to f() are called the ___ parameters (your book calls these arguments). (d) In Line 1 of f(), the a and b parameters of f() are called the ___ parameters (your book calls these simply parameters). (e) The parameter passing technique being used to copy the values of x and y from main() to a and b of f() is called pass ___-___. (f) A variable such as c defined inside the body of a function is called a ___ variable. The parameters a and b of f () are also ___ variables. (g) The scope of a variable such as x in main() is from ___ (describe where) to ___ (describe where). (h) When f() is called and line 2 is reached, c is ___ in memory. It remains [the word in the blank] until the function ___ at which time it is ___.


Explanation / Answer

A. 210
B. 19 6 ,calls
C. actual parameter
D. formal parameter
E. pass by value
F 1. local variable.
F 2. formal variable.
G. main to main
h. creates, completes, destroyed

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote