T2vE - end end B C ret1 = C ret2 = 600 A ret3 =[600 700 600 C-Needs to have a terminating condition-Needs to move towards termination-Need to have

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

View Full Document Right Arrow Icon
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))];
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: end end B. C. ret1 = [ ] C. ret2 = [ 600] A. ret3 = [600 700 600] C. -Needs to have a terminating condition -Needs to move towards termination -Need to have a call to a clone of the function CS1371 – Test 2 Version E Solutions October 24th, 2007 Problem 4 – Plotting [50 Points] 1 - subplot(2, 2, 1) 2 - C 3 - E 4 - F 5 - G OR H 6 - H OR G if 5 is H 7 - subplot(2, 2, 2) 8 - B 9 - E 10 - F 11 - G OR H 12 - H OR G if 5 is H 13 - subplot(2, 2, 3) 14 - A 15 - E 16 - F 17 - G OR H 18 - H OR G if 5 is H 19 - subplot(2, 2, 3) 20 - D 21 - E 22 - F 23 - G OR H 24 - H OR G if 5 is H B. 1. C. linspace( 0, 2*pi) 2. B. vv 3. D. uu 4. A. rr.*cos(tth) OR C. rr.*sin(tth) 5. C. rr.*sin(tth) OR A. rr.*cos(tth) if 4 is C. rr.*sin(tth)...
View Full Document

This note was uploaded on 05/08/2010 for the course CS 1371 taught by Professor Stallworth during the Fall '08 term at Georgia Institute of Technology.

Page1 / 2

T2vE - end end B C ret1 = C ret2 = 600 A ret3 =[600 700 600 C-Needs to have a terminating condition-Needs to move towards termination-Need to have

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online