Lab 12

Program 5 Design

April 13, 2006

Lab Partners

Everyone should work with one lab partner on this assignment.

Purpose

Program 5 is due two weeks from today. The purpose of this week's inlab is to help you start thinking about and designing a solution for this final programming assignment. To paraphrase an old saw, an ounce of design is worth a pound of programming and debugging.

Task

  1. 2 points. Solve the missionaries and cannibals problem. Draw a picture of the solution.
  2. 2 points. Show how the simplified breadth-first search algorithm described in the Program 5 write-up would find the solution. Draw a picture of the queue initially, draw another picture when the queue contains states that are 1 step away from the start state, draw another picture when the queue contains states that are 2 steps away from the start state, etc., until you draw a picture when the queue contains states that are n steps away from the start step and these states include the goal state.
  3. 2 points. Determine the classes that you will need to solve this problem. Draw a UML diagram that shows the relationships between these classes. Provide a brief comment regarding the purpose of each class.
  4. 2 points. Add to the UML diagram the methods that you anticipate that each class will need. Remember to indicate whether the method will be public or private. Provide a brief comment regarding any method whose purpose is not obvious.
  5. 2 points. Add to the UML diagram the instance variables that you anticipate that each class will need. Remember to indicate whether the instance variable is public or private. Provide a brief comment regarding any instance variable whose purpose is not obvious.

Note: your final UML diagram should look something like the Airline Check-In Simulation UML diagram in Figure 6.16 on page 329 of the course textbook by the time you are done with the final three steps above.

What to Submit

Give the above materials to your lab TA before the lab session ends.