$shape->sideLengths[] = 2; $shape->sideLengths[] = 2; $shape->sideLengths[] = 2; //Then put the height and width into the constructor (in that order) $shape->__construct(6.15, 6.15, 100); //Demos the double function $shape->double($shape); //Demos the printShape function $shape->printShape(); //Rectangle $rec = new Rectangle(); $rec->__construct(4, 8, 20, 4, 2); $rec->printShape(); //Square $sq = new Square(); $sq->__construct(10, 40, 0, 5); $sq->printShape(); //Triangle $tri = new Triangle(); $tri->__construct(35, 20, 20, 50, 50, 50); $tri->printShape(); //Oval $oval = new Oval(); $oval->__construct(10, 9, 8); $oval->printShape(); //Circle $circle = new Circle(); $circle->__construct(80, 80, 10); $circle->printShape(); //Demos the getAreas function $shape->getAreas($shape, $rec, $circle);
/** * @param integer $position * @param HomeSquare $homeSquares */ public function __construct($position, HomeSquare $homeSquares) { parent::__construct($position); $this->homeSquares = $homeSquares; }