Please use any suggested abbreviations (in non-gray),
to save writing.
In addition, I recommend using short
(but mnemonic) field-names (3 letters or so).
E.g., “def/c”
for
“define/contract”, “def-str/c”
for
“define-struct/c”, “mk-…”
for
“make-…”, “str<?”
for
“string<?”, and “nat?”
for
“natural?”.
Unless otherwise specified,
you may write any exam-code in Java, or in Racket.
You may switch languages between problems;
just be sure to use the correct field/struct names.
For each java method, specify
which class that method belongs in.
If using Java,
you may use records,
or regular classes where
you can assume
a standard/boilerplate
constructor, toString, equals, and hashCode
have been written.
For any question,
you may use functions defined in previous questions,
even if you didn't complete the previous question.