CSE341 Final Exam Topics
I might ask some essay-style questions where I would ask you to reflect on
concepts like the idea of a closure that we have been discussing all quarter.
This document describes what you can expect in terms of Scheme and Ruby
programming questions.
Each of the following Scheme topics is "fair game" in the sense that there
might be an exam question that requires you to know how to use this construct
without reminding you of how to use it:
- let and let*
- defining procedures, including helper procedures and lambdas
- use of accumulating parameters for efficiency (e.g., to make a procedure
tail recursive or to avoid recomputing results)
- list operations: car, cdr, cons, append, list, length
- conditional execution: either if or cond
- sequential execution: begin
- numeric operators: +, -, *, /, quotient, modulo, <, >, <=, >=, =
- boolean values and operators: #t, #f, and, or, not
- predicates: null?, pair?, list?, number?, integer? equal?, member
- mutating procedures: set!, set-car!, set-cdr!
- output procedures: display, newline
- quoting when necessary
- calling error when an error occurs
The following Scheme constructs are considered to be special in the sense that
if you are expected to use them in a problem, the problem will specifically
remind you of how the construct works. Unless otherwise noted, you will be
able to use these constructs in writing your solutions, but it will be possible
to solve the problems without them:
- letrec
- higher-order procedures: map, filter, foldl, foldr, andmap, ormap,
quicksort
- list variants: cadr, caddr, cddr, first, second, etc
- data as code: eval, apply
- datatypes: define-struct
- macros: define-syntax
- rest of the language: max, min, sqrt, string-upcase, string->number, eq?,
eqv?, etc.
Ruby "fair game" topics:
- defining top-level methods
- defining classes, including constructors (initialize), instance
variables, instance methods, private methods, defining accessors and
mutators ("getters" and "setters") as simple methods (without calling
attr_reader or attr_accessor)
- extending existing classes (e.g., Integer)
- calling new to construct objects
- defining methods that call yield (iterators, filters, etc)
- assignment: =, *=, +=
- basic numeric operators: +, -, *, /, %, **
- boolean values and operators: true, false, &&, ||, !
- basic control structures: if/else, while, break
- standard I/O: puts, gets, chomp, print or printf (know how to use at
least one)
- Array basics: defining, << or push, pop, indexing elements, member?,
sort, index, length, delete
- String basics: defining, <<, indexing elements, + (concatenation),
substring notation, length
- Range basics: defining with .. notation, for, each
- comparisons: <, >, <=, >=, ==, !=
- standard conversions: to_s, to_i
- use of standard methods that take a block: each, map
- reading a file: File.open, use of file variable
- pseudo random number generation with rand(n)
Ruby special topics:
- other control structures: unless, until, case, loop, begin
- Hash objects (like Java Map objects)
- other string methods: upcase, downcase, split, etc.
- other array methods: +, -, *, count, zip, etc.
- other arithmetic operators: Math.sqrt, abs, etc.
- other methods that take blocks: any?, all?, find, find_all, inject,
times, etc.
- other input/output: readline, readlines, close, etc.
- class variables and methods
- rest of Ruby: modules, mixins, callcc, etc.
Stuart Reges
Last modified: Mon Mar 12 11:19:10 PDT 2007