INFORMATION & COMPUTER SCIENCE DEPARTMENT, KFUPM

ICS102 SECTION 02&13  (002 Semester)

Introduction to Computing

Home Work   #02

 

 

 

1.  Write an applet, Circles, to draw five concentric circles as follows:

(a)                The circles should be drawn at the center of the applet window.

(b)               The circles should be in different colors of blue, green, red, cyan and black.

(c)                The diameter of the outer-most circle should be 200 and the diameter of each inter circle should be less than that of its immediate outer circle by 20%;

 

 

2.  Modify the Circles applet in (1) so that the circles have common tangent as shown below.  name your class as Circles2:

 

3.  Modify the Circles2 applet in (2) so that the diameter of the outer-most circle and the percentage decrease is read as input either using HTML parameters or dialog window.  Name your class as Circle3.

 

4.   Answer exercise P3.2 on page 136 of the ICS102 reference book.

 

5.   Answer exercise P3.3 on page 136 of the ICS102 reference book

 

Submission Notes:

  1. Submit both the printed copy and the soft copy in an envelope on or before beginning of class on Saturday, 7/4/2001.   – continue back page
  2. You must compile each of your classes.  The grader will not compile any for you.  Also you must provide HTML file for each applet program.
  3. All your programs files should be saved in a folder HW2 on your diskette.
  4. Code your programs according to the Java naming conventions on  this link.
  5. Indent your work so that content of a class and methods are pushed inside by a tab or at least three spaces.
  6. Use comments at the beginning of each program to explain its purpose.  Also include your name and ID number as part of the comment.
  7. Use comments to explain each variable whose purpose cannot be determined from its name.