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>