t2vD - ret = 0; else switch vec(1) case {'a', 'e', 'i',...

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

View Full Document Right Arrow Icon
CS1371 – Test 2 Version D Solutions October 24th, 2007 CS 1371 Computing for Engineers Test 2 Version D Solutions – Fall Semester 2007 Problem 1 – Structure Arrays [50 Points] 1. varA = B. {‘Name’;’Type’;’Position’} 2. varB = C. 1 3. varC = D. 0 4. varD = C. ’TaylorTashardPhilipTravis’ 5. varE = A. [13 22 100] 6. varF = C. ’QBRBLBK’ 7. varG = D. Error Problem 2 – File I/O [50 Points] 1. varA = C. ‘Dave’ 2. varB = B. 13 3. varC = A. 2 4. varD = A. 0 5. varE = B. 1 6. varF = A. 0 Problem 3 – Recursion [50 Points] A. function ret = rec_Vowels(vec) if length(vec)==0
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: ret = 0; else switch vec(1) case {'a', 'e', 'i', 'o', 'u'} ret = 1 + rec_Vowels(vec(2:end)); case {'y'} ret = 0.5 + rec_Vowels(vec(2:end)); otherwise ret = rec_Vowels(vec(2:end)); end end B. A. ret = 10 C. ret = 50 C. ret = 800 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 D Solutions October 24th, 2007 Problem 4 Plotting [50 Points] A. 1. A, C 2. B, D 3. E 4. A, B 5. A, B 6. C, D 7. C, D B. 1. False 2. False 3. True 4. False 5. True...
View Full Document

Page1 / 2

t2vD - ret = 0; else switch vec(1) case {'a', 'e', 'i',...

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