Docsity

Practice Final Exam - Computing for Engineers - Fall 2004 | CS 1371, Exams of Computer Science

Partial preview of the text

Download Practice Final Exam - Computing for Engineers - Fall 2004 | CS 1371 and more Exams Computer Science in PDF only on Docsity!

CS1371 Practice Final Fall, 2004 Problem 1 Finish the java code to make the following shape. Each shape should have its own color (the interior of each shape, not just its border should be colored). Keep in mind that you should be able to see all the shapes that are drawn. Note: The circles are concentric (they have the same center point) with radii 50, 100 and 150 The square is tangent to the edges of the largest circle The lines begin and end on opposite points of the square. public void paintComponent(Graphics g) { Set Color (Color. Rec) | fill Get (6,0, 159, 150) , ded Glee ele Blue) < Gill wel (og, 154 iso). Set color a green) § MM ove (1,91 9, 100 | (0) ; a le. welow) fr |g be 50 a Ser Color (color. blee ) 5 Oy a Line / (oy $54 in f drow b Ke. re fn fy Page 3 of 5 AB oD EF @ HT 56)