midterm-solutions-odd

midterm-solutions-odd - COP -5 5 55 PROGRAMMING LANGUAGE...

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

View Full Document Right Arrow Icon
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
Background image of page 3

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

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

Unformatted text preview: COP -5 5 55 PROGRAMMING LANGUAGE PRINCIPLES Fall 2010 Instructor: Manuel Bermudez MIDTERM EXAM In-Class‘ Closed Book. Closed Notes. 50 minutes Problem 1 __ _(30p.] Problem 2__H__)L__(35p.) Problem 3 r _(25p.) Problem 4__fD__(10p.) SCORE_____(100p.) S 0k, u T} w NAME_____—_*__—H__ NOTE: Turn in your work on this exam only gm Wé {1/1033 33 Z ’2‘) 27 mil-1‘ COP—5555 PLP MIDTERM Fall 2010 Page 3 of 15 WORKSPACE COP—5555 PLP 91353;; x A; 602: kick MIDTERM Fall 2010 WORKSPACE no: 0 . x7, 1? £9 €4.23?- €460 3 qu 2/61) @1439 '4 01316; 61/89 '1‘ 153 £280 Page 5 of 15 COP—5555 PLP MIDTERM Fall 2010 Page 7 of 15 PROBLEM 3. (25 points) Write a complete RPAL function that will insert an element into a tuple. in a given location n. For example‘ the following will insert the string 'abc‘ at location 2 in the tuple (1.3.7): insert {1,3,7} 'abc' 2 = (1, ’abc’ , 3, 7). Make sure you check for errors: the first argument must be a tuple. and the third argument must be an integer between I and the order of the tuple. The types of elements in the tuple do not matter. nor does the the type of element being inserted. (Jim; T E, i = Mi T ‘3 'flww 1 ml Eatery: ; —) leww ‘ vol 3x I] a {I flfl (Otda‘l'llj —9 IEWovl ‘ Pmml' w m Primal Ta i m = ( mioamg l neat J) Med" T8? (III-D (iqu (Tr-t) l Vino-l Tc} (tn-D our? (Tm) J l 5 // valr (‘42le ) {WW 7 “W ) ( ') “1ij ) 7D) 3F ...
View Full Document

Page1 / 4

midterm-solutions-odd - COP -5 5 55 PROGRAMMING LANGUAGE...

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

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