Lab Assignment 1
Write a program in C, C++, or Java, that implements Bresenham's algorithm
for drawing lines and the midpoint circle algorithm for drawing circles.
Your program must read from standard input a list of lines and circles
to be drawn in one window, without erasing the window. Your program must
accept input in the following format. Each object, line or circle, must
appear on a separate line. The first word indicates which object is to
be drawn. Lines are specified by the x and y values for the initial point,
and the x and y values for the final point. Circles are specified by the
x and y values of the center and the radius. All numbers must be integers.
Here is some example input:
line 30 40 100 80
circle 200 300 70
line 300 400 30 200
line 400 10 50 200
This should result in a window showing three lines and one circle.
If you are using C, or C++, you may start with simple-x.c,
the C code shown in class for initializing an X window and drawing points
in it. If you want to use Java and are unfamiliar with the graphics classes
in java.awt, then Simple.java might be helpful.
You will be electronically checking in your code. This will be explained
to you later. Watch the class web page for the
instructions on how to do this.