CS115_Fall2010

CS115_Fall2010 - copyright 2010 Oda_Eagle Production, all...

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

View Full Document Right Arrow Icon
copyright 2010 Oda_Eagle Production, all right reserved CS115/116/125/134/135/136/2**/3** Private Tutor e aglediao@gmail.com TEL: 519-497-0989 UWaterloo CS115 Final Exam Question Pack last update December 6 th , 2009 Note: there is no solution come with this question pack, solution not for sale as well, you have to attend Eagle's class to access the full solution, please respect my work. 使用須知:本題集不付答案,答案也不發售,必須參加我的課程才可以有機會接觸到答案,請 競爭對手尊重我的勞動成果,不要擅自利用于任何商業目的。 希望所有參考這份題集的同學都能考出理想的成績! Eagle 的補習班常年招生,請加 MSN odaeagle@hotmail.com make sure you send a email E-mail : eaglediao@gmail.com
Background image of page 1

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

View Full DocumentRight Arrow Icon
copyright 2010 Oda_Eagle Production, all right reserved CS115/116/125/134/135/136/2**/3** Private Tutor e aglediao@gmail.com TEL: 519-497-0989 Part1. Warm-up Questions the purpose of this part is let you remember most material we have learned through out this term, take them as a reminder of material you may have missed. 1. Assume the following code already exist, fill in the blank if each line of code on the left column is executed in the interaction window. ( substring str 0 ) ( substring str 4 ) ( substring str 0 1 ) ( substring str 4 5 ) ( first lst ) ( first ( rest ( rest lst ) ) ) ( first lol ) ( first ( rest lol ) ) ( first ( first lol ) ) ( rest lol ) 2. For each of the following question, write a single line of code. (1) given a string str , get a string formed by first char of str and last char of str . (2) given two strings str1 and str2 , get a string formed by insert str2 in the middle of str1 . (3) given a list lst , return a new list by putting head of lst to the tail. (4) given a list of string lst , return a new list by merging the first two strings together and keep the rest of the list. 3. For each of the following question, write a scheme function, you decide the name. (1) given a list of string los , return a new list of string by keeping only the first four digits of the string in the original list. If the string has length smaller than 4, than just keep whatever it has. (2) given a list of list lol , flatten the list, which is, if given ( list ( list 1 2 ) ( list 3 4 ) ), your function should return ( list 1 2 3 4 ).
Background image of page 2
copyright 2010 Oda_Eagle Production, all right reserved CS115/116/125/134/135/136/2**/3** Private Tutor e aglediao@gmail.com TEL: 519-497-0989 Part 2. Structures and Recursive Definition. 1. For each of the following questions, write a scheme definition and choose the most appropriate type for each field. (1) given data about a people , name, age, height, gender (2) given data about a employee , name, gender, title, salary (3) given data about a movie , title, director, length, restriction 2. For each of the above structures, write a recursive definition for list of that structure (1) list of people (2) list of employee (3) list of
Background image of page 3

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

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

This note was uploaded on 01/21/2012 for the course MATH 235 taught by Professor Celmin during the Spring '08 term at Waterloo.

Page1 / 12

CS115_Fall2010 - copyright 2010 Oda_Eagle Production, all...

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