If you need to refresh your programming skills with the Big C++ Graphics Package, you should attempt to complete the following tasks in your time outside of this lab period. During the lab you should work on the tasks presented in the actual lab. If you are having dificulty with the lab, don't be afraid to ask your lab partner for help.
A framework containing the files and folders you will need can be found here. Download the .tgz file and decompress it in your account using the command:
tar -xzvf <file_name>
The following tasks require you to use the graphical package that is described in Chapter 3 of the Big C++ book. A introduction to using the tools that are described in that chapter can be found here.
Use the file octagon.cpp to program the following task. Given a coordinate system where the upper lefthand corner is (0,0) and the lower righthand corner is (3,3), write a graphics program to draw a stopsign like this:
To compile the file octagon.cpp type:
at the command prompt. The executable generated will be called octagon.
Use the file con_circles.cpp to program the following task. Using the default coordinate system, generate five circles with center (0,0) and radius 1, 2, 3, 4, and 5. Output the five circles to the graphic window. The output should look like a bullseye.
To compile the file con_circles.cpp type:
at the command prompt. The executable generated will be called con_circles.
This task is a variation on the concentric circles you produced in the previous task. If you want, you may reuse the code you have already written. Use the file tan_circles.cpp to program the following task. Using the default coordinate system, generate five circles with center (0,0) and radius 1, 2, 3, 4, and 5. Use the move method of the Circle class to draw the circles all tangent at a common point, like this:
To compile the file tan_circles.cpp type:
at the command prompt. The executable generated will be called tan_circles.
In the supplement for this lab there is a "self portrait". When you finish with all of the other tasks use the file portrait.cpp to draw a "self portrait" of your own. You may use the code from the supplement as a base, or start from scratch. Play with the graphic elements from the library and see what you can come up with.
To compile the file portrait.cpp type:
at the command prompt. The executable generated will be called portrait.