CS 1410-20 Lab 8

(This lab is a Java-ized variant of lab 2. If it’s too easy, work on the homework instead. If you’re already done with the homework, try HW 8 in Java.)

  1. Choose a representation for Toast:
  2. Implement a isYummy method for Toast. Toast is yummy when it’s white bread toasted to a level between 6 and 8 inclusive.
  3. Choose a representation for Bagels:
  4. Implement isYummy for Bagels (specified however you like—examples should clarify).
  5. Define a bread datatype, which can be toast or a bagel, as IBread.
  6. Declare isYummy so that it works on any IBread.
  7. Implement a toast method on IBread. Teating bread returns bread whose toastedness is greater by 1—unless it is already 10.

Last update: Wednesday, November 3rd, 2010
mflatt@cs.utah.edu