CS 334: HW 7

Instructions

This homework has two types of problems:

  • Self Check: You are strongly encouraged to think about and work through these questions, but you will not submit answers to them.

  • Problems: You will turn in answers to these questions.

Reading

Self Check

1. Smalltalk Run-time Structures

Mitchell, Problem 11.4

The given conversions between Cartesian and polar coordinates work for any point (x,y), where x \geq 0 and y > 0. Do not worry about points where x < 0 or y \leq 0. The figure P.11.4.1 appears on page 332.

You should try to write reasonably accurate Smalltalk code for part (b), but you do not need to use Squeak.

Problems

1. Removing a Method (10 points)

Mitchell, Problem 11.7

2. Protocol Conformance (15 points)

Mitchell, Problem 11.6

(You will find it useful to answer Problem 11.7 first before working on this one.)

3. Subtyping and Binary Methods (10 points)

Mitchell, Problem 11.8

4. Delegation-Based OO Languages (15 points)

Mitchell, Problem 11.9

Submitting Your Work

Submit your answers to the GradeScope assignment named, for example, "HW 0". It should:

  • be clearly written or typed,
  • include your name and HW number at the top,
  • list any students with whom you discussed the problems, and
  • be a single PDF file, with one problem per page.

You will be asked to resubmit homework not satisfying these requirements. Please select the pages for each question when you submit.