Spring 2001 CS100M Solutions to Exercise E6 Core Questions to the left of each choice is the number of peopel who chose it. the correct choice is marked with an arrow (-->). 1. Where can you find an animation tracing the process of calling a function? 1 the Chapman textbook 23 the Examples webpage, along with the 2/20 lecture --> 148 the ProgramLive CD 5 none of the above 2. Fill in the blank: the technical term for "tell the computer to run a specific function" is to _________ the function. 2 activate 1 argue 1 display --> 171 invoke note: another valid term is to *call* the function. 0 parameterize 0 pass 0 print 2 return 3. Roughly speaking, what does the technical term "shadowing" mean? 20 the new value assigned to a variable hides the old value 92 a function hides a variable with the same name 1 a lowercase function name hides the same name in uppercase --> 64 none of the above 4. What does the technical term "activation record" mean? 9 the "BIG piece of paper" with the names of all the functions 6 the "paper airplane" a function uses to send back its answers --> 131 the "scratch paper" that holds a function's local variables 22 the list of functions that have been called 9 none of the above 5. Is there any difference between "passing" and "returning" a value? 1 No, no difference --> 170 Yes, "pass" is from caller to callee, "return" is from callee to caller 2 Yes, "pass" is from callee to caller, "return" is from caller to callee 4 Yes, but none of the above 6. Can functions see printed values? --> 172 No 5 Yes 7. Is there any difference between "printing" and "returning" a value? 3 No, no difference --> 169 Yes, "print" = "write on chalkboard", "return" = "send back on paper airplane" 0 Yes, "print" = "send back on paper airplane", "return" = "write on chalkboard" 5 Yes, but none of the above 8. Suppose function $capitalize$ uses function $upper$. Can this relationship be characterized in terms of "caller" and "callee"? 1 No 5 Yes, but none of the above 11 Yes: $capitalize$ is the callee, $upper$ is the caller --> 154 Yes: $capitalize$ is the caller, $upper$ is the callee 1 Yes: both are callees 5 Yes: both are callers 9. If student Irvin asks student Igor to perform a task and throws a paper airplane to Igor, how does Igor know how to match up arguments with parameters? 0 by alphabetical order 0 by reverse alphabetical order --> 160 by sequential order 0 by reverse sequential order 6 by a method not given above 11 he doesn't: arguments are not matched with parameters! 10. Can a function be both a caller and a callee? 13 No --> 164 Yes