lunes, 4 de febrero de 2013

Ejercicio: Propuesta_04.php


<?php
/*
Author:Andrea
Date: 04/02/2013
Nombre del Fichero: Propuesta04.php
Descripción: Calificaciones
*/
?>
<html>
<head>
<title>Puntuación media</title>
<body bgcolor="pink"><font face="verdana"> <font size="+1">
<p>
<?php

 extract($_REQUEST);
if ( ! isset ($enviar )) { 
  exit;
  }
  
?>
<table border="1" cellpadding="10"><tr bgcolor="pink">
<?php
 $nota=($nota1+$nota2+$nota3)/3;
  if ($nota > 0 && $nota < 30) {
    $Resultado = "D";
print "<td><b> Su nota final es la $Resultado.</td>";
  }
  elseif ($nota >=31 && $nota < 50 ){
    $Resultado = "C";
print "<td><b>Su nota final es la $Resultado.</td>";
  }
  elseif ($nota >=51 && $nota <=70 ){
    $Resultado = "B";
print "<td><b>Su nota final es la $Resultado.</td>";
  }
  elseif ($nota =71 && $nota <=100 ){
    $Resultado = "A";
    print "<td><b>Su nota final es la $Resultado.</td>";
  }
 ?>
</tr>
</table>
</font>
</body>
</html>

Ejercicio: Propuesta_04.html


<?php
/*
Author:Andrea
Date: 04/02/2013
Nombre del Fichero: propuesta04.HTML
Descripción: Calificaciones
*/
?>
<html>
<head>
<title>Calificaciones</title>
<body bgcolor="pink"><font face="verdana"> <font size="+1">
<form method="GET"  action="propuesto04.php">
</head>
<body>
<p> Nota Test 1<br>
<input type="text" size=1 name="nota1" <br /> 
<p> Nota Test 2<br>
<input type="text" size=1 name="nota2" <br /> 
<p> Nota Test 3<br>
<input type="text" size=1 name="nota3" <br /> 
<br>
<br>
<input type=submit name="enviar" value="Calcular media" <br />
</body>
</html>

jueves, 31 de enero de 2013

Ejercicio: Propuesta_03.php


<html lang="es">

<head>
   <title>Tabla de multiplicar</title>
   
</head>

<body>

<h1>Tabla de multiplicar</h1>

<?php

  $n = 1;
  for ($n=1; $n<=10; $n++){
  print ("<P>La tabla de multiplicar del $n es:</p>\n");
  for ($i=1; $i<=10; $i++)
     print ("$n x $i = " . $n*$i . "<BR>\n");
}
?>

Ejercicio: Tabla Multiplicar.php


<html lang="es">

<head>
   <title>Tabla de multiplicar</title>
   
</head>

<body>

<h1>Tabla de multiplicar</h1>

<?php

  $n = 5;
  print ("<P>La tabla de multiplicar del $n es:</p>/n");
  for ($i=1; $i<=10; $i++)
     print ("$n x $i = " . $n*$i . "<BR>/n");
 
?>

Ejercicio: eje7.6.php


<?php
/*
Author:Andrea
Date: 31/01/2013
Nombre del Fichero: El bucle While
Descripción: Tarifa de precios
*/
?>
<html>
<head>
<title>Constructores de bucles</title>
<body bgcolor="lightblue">
<h3>El Bucle For</h3>
<font face='arial' size='+1'>
<?php

  for( $i = 0; $i < 10; $i++ ){
    echo "$i ";
  }
  
?>

Ejercicio: eje7.5.php


<?php
/*
Author:Andrea
Date: 31/01/2013
Nombre del Fichero: El bucle While
Descripción: Tarifa de precios
*/
?>
<html>
<head>
<title>Constructores de bucles</title>
</head>
<body bgcolor='f0f8ff'>
<font face=arial size='+1'>
<?php

  $i=10;
  do{
       echo "$i ";
  $i--;
  }while ($i > 0 );
  
?>
</font>
</body>
</html>

Ejercicio: eje7.4.php


<?php
/*
Author:Andrea
Date: 31/01/2013
Nombre del Fichero: El bucle While
Descripción: Tarifa de precios
*/
?>
<html>
<body>
<h3>El Bucle While</h3>
<font face=arial size='+1'>
<?php

    $i=0; //Iniciando contado de bucle
while ($i <= 10 ) { //Condicion
   echo "$i ";
$i++; //Decrementa el contador
} // Fin del loop


?>
<font size="+3" color="red">
...Fuegoooo!!
</font>
</body></html>