Example Two: Drawing a Map
Section: Examples
...Subsection: Example Two: Drawing a Map
- Statement of the Problem
- Nancy has moved to a new town and her aunt wants to visit her. Nancy
wants to use her new computer to draw a map from her aunt's home to
her new house. She decided to use the computer so she can produce
copies easily to send to other friends later.
- Tools Available
- Nancy thinks carefully about the tools she needs. She knows her computer
has a drawing program built-in, but she has never used the program. She
does know how to get to the program and start it up.
- Algorithm
- Nancy starts by drawing out the map with pencil and paper. Now she knows
the image she wants to create. She will use lines to indicate streets, squares
for specific landmarks, and text to label the streets and landmarks. When
she has finished with the picture, she will save it to her disk in case she
needs it again, and print it out to include in her next letter.
- Implementation
- Nancy stares at the blank screen. She doesn't know what to do next. She
knows that she has a number of new smaller problems:
- She needs to draw some rectangles.
- She needs to draw some lines.
- She needs to place some text on the picture.
- She needs to save the picture somehow.
- She needs to print the picture somehow.
Nancy has a dim recollection of the STAIR process from a computer class in
her distant past. She wonders if she should apply that process to one of
the smaller problems now. She decides to start with the rectangles:
- Statement of Problem: Nancy needs to draw a rectangle to represent
her Aunt's house.
- Tools: She spots a button on the toolbar that has a
picture of a rectangle! If she doesn't see it there,
she knows she can cruise the menus for a likely looking command, or
check the on-line help.
- Algorithm: She decides: "What the heck. I'll press
it and see what happens."
- Implementation: She presses the button. The cursor on this
screen changes, and when she drags the mouse on the screen, she is able to
draw a rectangle. She practices a few times until she has the hang of it.
- Refinement: After she knows how to make a rectangle
exactly how she wishes, she puts one where her aunt's house should be on the map.
- Refinement
- Nancy repeats the process to learn the other tools she might need. Most of
the things she needs relate directly to buttons on the toolbar. She does
not see a button that might represent printing. She looks in the on-line
help and finds that Print is an option in the File menu. She then looks
at the menu and finds the command right there. She uses it and the picture
shows up in her printer. Problem solved!
Notice that the problem solving process actually had to occur at two
distinct levels in this project. First, Nancy had to think about the big
picture of how to draw the map. As part of this larger problem, she
discovered a number of smaller problems along the way. She applied the
same kind of process to the smaller problems and was able to learn many new
skills as part of solving the larger problem. The next time she needs to
use this graphics program, she will already know how to use these
particular tools without having to re-learn them. In fact, if she tries ANY
graphics program, she will have a head start, because she already knows to
expect some kind of line drawing tool, rectangle tool, and other tools that
she learned to use in this program.
rms@cs.oberlin.edu