CS 214: Programming Languages
Spring 2009

Home|Syllabus|Schedule

Exam #3

Exam #3 is tied with the Final Exam.

Format

This will be your typical short-answer, fill-in-the-blank, true-false, multiple-choice test. It'll probably be worth between 65 and 100 points.

Interesting Questions

The "Standard" column lists topics and sample questions which I expect everyone to know; my plan is that a majority of the test (80% or more) will cover this material.

The "Bonus" column is advanced material, some of which we might not have covered. Some of it will be on the test, but don't bother studying it if you haven't studied the "standard" material first.

"CYU" refers to the "Check Your Understanding" sections of the book.

Topic Standard Bonus
Control Flow (Chapter 6)
  • CYU Questions #27--29, 31--33, 35 (think Haskell), p. 286
  • CYU Questions #38, p. 295
  • Exercises #6.8, 6.18; page 298
Data Types (Chapter 7)
  • CYU Questions #1–5, 7, 8, p. 320
  • CYU Questions #11–13, 17, 19, p. 336
  • CYU Questions #20–22, 24, 25, p. 348
  • CYU Questions #29–31, 33, 34, p. 365
  • CYU Questions #42, p. 378
  • CYU Questions #45–48, p. 395
  • Exercises #7.1, 7.2, 7.8, 7.10, 7.19, 7.20, 7.21, 7.22; page
It's a bit heavy on the array questions. Don't forget about garbage collection!
OOP Review the strategy pattern. Why does Java require an explicit interface and Ruby does not?

Memory Mapping Objects

This question combines several topics I find fairly important which the book doesn't quite stress enough (at least not in the exercises):

The source code for the CITkit library is available in the JAR file you've been using. If you open up the library in the Package Explorer in Eclipse, you can double-click on a class to see the source code.

Use the source code for IntegerETIR and OperatorETIR to create memory maps for these instances:

IntegerETIR i = new IntegerETIR(12);
IntegerETIR j = new IntegerETIR(99);
ExpressionTIR o = new OperatorETIR(i, Operator.ADD, j);

Indicate at the lowest memory level how these variables and the objects they refer to are mapped out in memory on a 32-bit machine (ints and pointers/references are all 32-bits). You need to map out the objects themselves and their virtual method tables.

If one object refers to another object, map out that other object.