SHARE
TWEET

Untitled

a guest Apr 27th, 2014 2 Never
  1.  
  2. public class Dyad extends Ball  
  3. BEGIN  
  4.  
  5.    public Dyad() // constructor
  6.    BEGIN
  7.       Ball() // call constructor method of super class
  8.    END
  9.    
  10.    public void draw() // over rides draw method of super class
  11.    BEGIN
  12.       integer radius = SuperClass.getRadius()
  13.       integer x = SuperClass.getX()
  14.       integer y = SuperClass.getY()
  15.       set colour for drawing to color
  16.       drawFilledOval in bounding rectangle,
  17.                 top left (x, y), bottom right (x + 2*radius, y + 2*radius)
  18.       drawFilledOval in bounding rectangle,
  19.                 top left (x+radius, y), bottom right (x + 3*radius, y + 2*radius)
  20.    END
  21.    
  22. END  // end class Dyad
RAW Paste Data
Top