CS 1410-20 Lab 2

  1. Choose a representation for toast:
  2. Implement yummy-toast?. Toast is yummy when it’s white bread toasted to a level between 6 and 8 inclusive.
  3. Implement toast-more, which takes some toast and makes it more toasted, if possible.
  4. Choose a representation for bagels:
  5. Implement yummy-bagel? (specified however you like—examples should clarify).
  6. Define the datatype for bread, which is toast or bagel.
  7. Implement yummy-bread?.
  8. Choose a representation for toasters:
  9. Implement should-turn-on-toaster?. Don’t turn on the toaster if it’s already on, or if the bread is a bagel has cream cheese or isn’t sliced, or if the bread is toasted more than level 6 already. The implementation will involve new functions on bread, etc.
  10. Implement maybe-turn-on-toaster, which turns on the toaster if it should.
  11. Define a datatype for a jelly sandwich, which combines two pieces of bread with jelly. Implement yummy-samdwhich?, which determines whether a sandwhich is made with two pieces of yummy bread.

Last update: Wednesday, October 20th, 2010
mflatt@cs.utah.edu