cs103_test4_2009f_v_01

cs103_test4_2009f_v_01 - CS 103 Test 4 Fall 2009 Problem 1....

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 103 Test 4 Fall 2009 Problem 1. (15 points) Enter answers to this problem into the function p1 (in the provided M-file p1.m ). A. The break statement is used to 1. terminate a loop 2. terminate a for loop but not a while loop 3. terminate a while loop but not a for loop 4. terminate a function B. The default scope in Matlab is 1. local for variables used in the body of a function but global for its formal parameters 2. global for variables used in the body of a function but local for its formal parameters 3. global both for variables used in the body of a function and for its formal parameters 4. local both for variables used in the body of a function and for its formal parameters C. If foo.m contains a primary function called foo and two subfunctions nick and ken , then nick can be called 1. only from within foo 2. from within foo or ken 3. only from within ken 4. only from within the Command Window D. The following commands are given: list(4).drink = 'milk'; list(4).sandwich = 'ham';
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 12/12/2009 for the course CS CS 103 taught by Professor Fitzpatrick during the Spring '09 term at Vanderbilt.

Ask a homework question - tutors are online