Ver Mensaje Individual
  #3 (permalink)  
Antiguo 27/04/2011, 10:22
Avatar de bocho0610
bocho0610
 
Fecha de Ingreso: enero-2010
Ubicación: <? echo "Santiago, Chile"; ?>
Mensajes: 341
Antigüedad: 14 años, 3 meses
Puntos: 26
Respuesta: Crea dos variables, $a y $b

seria algo...

Código PHP:
Ver original
  1. class Operaciones{
  2.     var $numero1;
  3.     var $numero2;
  4.         function Operaciones($a,$b){
  5.             $this->numero1=$a;
  6.             $this->numero2=$b;
  7.         }
  8.         funtion suma(){
  9.             return ($this->a+$this->b);
  10.         }
  11.         funtion resta(){
  12.             return $this->a-$this->b;
  13.         }
  14.         funtion division(){
  15.             return $this->a/$this->b;
  16.         }
  17.         funtion multiplica(){
  18.             return $this->a*$this->b;
  19.         }
  20.         funtion resultado(){
  21.             $this->suma;
  22.             $this->resta;
  23.             $this->division;
  24.             $this->multiplica;
  25.         }
  26. }

Código PHP:
Ver original
  1. $operar = new Operaciones(2,2);
  2. $operar -> resultado();
  3. echo $operar;


Si esque eso es lo que necesitabas :P
__________________
Sigueme en Twitter!
Septimoarte.cl <-- Un mundo en cine.