Uploaded by swaworuntu

assignment2

advertisement
Problem #
1
2
3
Style
/4
/4
/4
Syntax
/6
/6
/6
Correctness
/10
/10
/10
------------------------------------------------------------------Total
/20
/20
/20
Grand total _____/60
1. (20 points) Write a C++/FLTK program named hw6pr1.cpp which draws a Texas
flag from three filled rectangles and a filled polygon (for the star). Either
do some trig to find the 10 vertices of the star, or just draw it by hand on
some graph paper and read off the coordinates. Each colored rectangle has
dimensions in the ratio 1 to 2, i.e., the longest side is twice the shortest
side.
2. (20 points) Write a C++/FLTK program named hw6pr2.cpp which draws the
Olympic flag of five rings on a white background. Don't worry about making the
rings interlock, but do make the rings thick enough.
3. (20 points) Write a C++/FLTK program named hw6pr3.cpp which draws a
checkerboard like
http://upload.wikimedia.org/wikipedia/commons/thumb/b/b6/Draughts.svg/220pxDraughts.svg.png.
Note that the checkers are black circles with a red or white interior. Hint:
Use Putty's color picker to roughly match the peach and tan colors and use the
RGB values like this:
Color peach(fl_rgb_color(R,G,B));
Download