This preview shows page 1. Sign up to view the full content.
Unformatted text preview: UWaterloo CS115 Midterm_2 2009 Winter
2009 Oda_Eagle Production
The following notes are relevant for all questions:
• We use the term “Scheme” as a short form for “Beginning Student Scheme with List
• Unless we ask specifically for another part of the design recipe, the instructions “Create a
Scheme function” means that you are to give the definition only.
• Helper functions may be used anywhere you feel it appropriate
• We use arithmetic functions as well as following built-in functions, described briefly here for
◦ max determines the largest of two or more numbers
◦ min determines the smallest of two or more numbers
◦ sqrt determines the positive square root of a number
◦ string-length determines the length of a string
◦ string-append combines two or more strings into a single string, in the order given
◦ check-expect determines if two values are exactly the same, and is to be used for tests when
they are requested
◦ ( make-posn x y ) produces a posn structure with field value x and y
◦ (posn-x p ) and ( posn-y p ) produce the first and second fields of a posn p
◦ ( substring s p1 p2 ) produces a string containing the characters from a from postion p1
through p2 -1
招收 CS 大三課程以下学生有意者（具體請見詳表）
已经教过 100+的学生 ◦ 经验丰富，童叟无欺，价格...
View Full Document
- Fall '08