Since the program has been nicely divided into
steps and sub-steps, it is easy to see where
the COLOR
statements can be added.
The completed program is given below.
' House Picture ' ' Start Graphics SCREEN 12 ' Draw the House COLOR 7 ' White ' Draw the Walls LINE (150, 320)-(150, 200) LINE (320, 320)-(320, 200) ' Draw the Floor and Ceiling LINE (150, 320)-(320, 320) LINE (150, 200)-(320, 200) ' Draw the Roof LINE (150, 200)-(235, 100) LINE (320, 200)-(235, 100) ' Draw the Tree ' Draw the Trunk COLOR 6 ' Brown LINE (510, 400)-(510, 240) LINE (540, 400)-(540, 240) ' Draw the Leaves COLOR 2 ' Green CIRCLE (525, 160), 80 ' Draw the Grass COLOR 2 ' Green LINE (0, 300)-(150, 280) LINE (320, 280)-(510, 290) LINE (540, 295)-(640, 300) ENDNot all of these
COLOR
statements are needed: for example, the
pen color starts out white, so the first COLOR 7
does nothing.
But it is helpful to have a COLOR
statement for each object
so it is clear what color the object will be.
If several people were working on this program, how would you divide up the work?