CODIGO PHP
<?php
class animales {
var $habi;
var $ali;
var $tipo;
var $anim;
function Tipo($tipo)
{$this->Tipo=$tipo;
echo "TIPO: ".$this->Tipo;
}
function habitad($habi)
{$this->Habi=$habi;
echo "HABITAD: ".$this->Habi;
}
function alimento($ali)
{$this->Ali=$ali;
echo "ALIMENTO: ".$this->Ali;
}
function gato($anim){
$this->ani=$anim;
echo "NOMBRE: ".$this->ani;
}
function nace()
{echo "Nace";
}
function crecer(){
echo " Crece ";
}
function reproducirce(){
echo "Luego se reproduce";
}
function Morir(){
echo " y finalmente muere";
}
}
$animales=new animales();
$gato=$animales->Tipo("mamifero");
echo "<br>";
$gato=$animales->habitad("domestico");
echo "<br>";
$GATO=$animales->alimento("ratones");
echo "<br>";
$gato=$animales->gato(" gato");
echo "<br>";
$gato=$animales->nace();
echo "<br>";
$gato=$animales->crecer();
echo "<br>";
$gato=$animales->reproducirce();
echo "<br>";
$gato=$animales->Morir();
?>
No hay comentarios:
Publicar un comentario