<h1><center> ANIMAL</center></h1>
</html>
<?php
class Animales {
var $Tipo;
var $habitad;
var $alimento;
function nacer(){
echo "nacer";
}
function crecer(){
echo "crecer ";
}
function reproducir(){
echo "reproducir";
}
function morir(){
echo "morir";
}
function Animales($tip){
$this->Tipo=$tip;
echo "TIPO DE ANIMAL ".$this->Tipo;
}
}
class Alimentos {
function alimentos($al){
$this->alimento=$al;
echo "TIPO DE ALIMENTO ".$this->alimento;
}
}
class abitad {
function Abitad($habit){
$this->habitad=$habit;
echo "HABITAD NATURAL ".$this->habitad;
}
}
$alimentos= new Alimentos("pescado");
echo"<br>";
$animales= new Animales("gato");
echo"<br>";
$Abi= new abitad("casa");
echo"<br>";
$gato=$animales->nacer();
echo"<br>";
$gato=$animales->crecer();
echo"<br>";
$gato=$animales->reproducir();
echo"<br>";
$gato=$animales->morir();
?>

No hay comentarios:
Publicar un comentario