{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

# t2vE - end end B C ret1 = C ret2 = 600 A ret3 =[600 700 600...

This preview shows pages 1–2. Sign up to view the full content.

CS1371 – Test 2 Version E Solutions October 24th, 2007 CS 1371 Computing for Engineers Test 2 Version E Solutions – Fall Semester 2007 Problem 1 – Structure Arrays [50 Points] 1. varA = B. {’fname’; ’lunch’; ‘lname’} 2. varB = B. 1 3. varC = A. 0 4. varD = C. ’JackWinnieHumpty’ 5. varE = C. ’CornerWoodsHill’ 6. varF = C. ’HornerPoohDumpty’ 7. varG = D. Error Problem 2 – File I/O [50 Points] 1. varA = C. 9 2. varB = A. ‘Ian’ 3. varC = A. 0 4. varD = B.10 5. varE = A. 0 6. varF = B. 1 Problem 3 – Recursion [50 Points] A. function ret = recursiveUpper(vec) if length(vec)==0 ret = ''; else temp = vec(1); if ((temp>=97) && (temp<=122)) temp = char(double(temp)-32); ret = [temp recursiveUpper(vec(2:end))]; else ret = [temp recursiveUpper(vec(2:end))];

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document