'
'SIMPLE CLASSES
'==============

 'The methods are defined inside the class block.
 '
  '-------------
  class cuboid
  '=============

  protected    

  height as double
  width  as double
  length as double

  public

  method surface() as double
    return (length*width+length*height+width*height)*2
  end method

  method volume() as double
    return length*width*height
  end method

  method setsize(l as double,w as double, h as double)
    length=l : width=w : height=h
  end method

  end class


  cuboid cu
  cu.setsize 10,5,2

  print "Volume:" tab cu.volume() cr "Surface:" tab cu.surface()
  
  
  '----------
  class brick
  '==========

  has cuboid 'dimensions and also ..

  protected

  density as double
  material as string
  
  public

  method setmaterial(m as string)
    material=m
    density=1
    if m="ceramic" then density=2
    if m="concrete" then density=2.5
    if m="ice" then density=0.95
  end method

  method weight() as double
    return volume()*density
  end method

  end class

  brick br
  br.SetMaterial "concrete"
  br.SetSize 20,10,7.5

  print "Brick weight: " br.weight


    
    
