COM1100 -- Winter2000 -- Yuhong Yin
6
Question 1
nSuppose there is a data file PaintData.txt with the following contents:
ncircle 100 100 20
n rectangle 40 40 90 80
n rectangle 140 140 190 180
n circle 200 200 50
nThe first column in each line is a label.
nIf the label is equal to “circle”, then the following data in this line are xcenter, ycenter and radius for painting a circle.
nIf the label is equal to “rectangle”, then the following data in this line are x1, y1, x2 and y2 for painting a rectangle.
nRead all the data from the file and paint either circls or rectangle according to the corresponding labels.