0% found this document useful (0 votes)
39 views8 pages

Tarea 1 PHP Códigos.

The document contains code for 3 PHP programs: 1) A form to collect a student's name, grades, and calculate their total and average grade. It displays if they passed or failed. 2) A form to collect numbers and perform basic math operations (sum, subtraction, multiplication, division). 3) A form to collect 3 numbers and determine the greatest number. It displays the result.

Uploaded by

Debora Sales
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views8 pages

Tarea 1 PHP Códigos.

The document contains code for 3 PHP programs: 1) A form to collect a student's name, grades, and calculate their total and average grade. It displays if they passed or failed. 2) A form to collect numbers and perform basic math operations (sum, subtraction, multiplication, division). 3) A form to collect 3 numbers and determine the greatest number. It displays the result.

Uploaded by

Debora Sales
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

TAREA 1 PHP

Debora Sales 5to. Comercial


Codigo Programa 1:
<title>CALIFICACIONES</title>

</head>

<body>

<form id="form1" name="form1" method="post">

<p>

<label for="textfield">INGRESE SU NOMBRE :</label>

<input type="text" name="nombre1" id="textfield">

</p>

<p>

<label for="textfield2">INGRESE SU APELLIDO:</label>

<input type="text" name="apellido1" id="textfield2">

</p>

<p>

<label for="textfield3">INGRESE EDAD:</label>

<input type="text" name="edad1" id="textfield3">

</p>

<p>

<label for="textfield4">NOTA 1:</label>

<input type="text" name="nota1" id="textfield4">

</p>

<p>

<label for="textfield5">NOTA 2:</label>

<input type="text" name="nota2" id="textfield5">

</p>

<p>

<label for="textfield6">NOTA 3:</label>

<input type="text" name="nota3" id="textfield6">


TAREA 1 PHP
Debora Sales 5to. Comercial
</p>

<p>

<label for="textfield7">NOTA 4:</label>

<input type="text" name="nota4" id="textfield7">

</p>

<p>

<label for="textfield8">TOTAL:</label>

<input type="text" name="total" id="textfield8" value="<?php

echo $total=$nota1+$nota2+$nota3+$nota4;?>

">

</p>

<p>

<label for="textfield9">PROMEDIO:</label>

<input type="text" name="promedio" id="textfield9" value="<?php

$promedio=$total/4;

echo "el total es $promedio";

?>">

<input type="submit" name="submit" id="submit" value="Enviar">

</p>

<p>&nbsp;</p>

</form>

<?php

if ($promedio>=70)

echo"GANO";

else

echo"PERDIO";

?>
TAREA 1 PHP
Debora Sales 5to. Comercial
TAREA 1 PHP
Debora Sales 5to. Comercial
CODIGO PROGRAMA 2:
<title>Operaciones Basicas</title>

</head>

<body>

<form id="form1" name="form1" method="post">

<p>OPERACIONES BASICAS </p>

<p>

<label for="textfield">Ingrese No.1:</label>

<input type="text" name="num1" id="textfield">

</p>

<p>

<label for="textfield2">Ingrese No.2:</label>

<input type="text" name="num2" id="textfield2">

</p>

<p>

<label for="textfield3">Ingrese No.3 :</label>

<input type="text" name="num3" id="textfield3">

</p>

<p>

<label for="textfield4">Ingrese No.4:</label>

<input type="text" name="num4" id="textfield4">

</p>

<p>

<input type="submit" name="submit" id="submit" value="Enviar">

</p>
TAREA 1 PHP
Debora Sales 5to. Comercial
<p>

<label for="textfield5">SUMA:</label>

<input type="text" name="s" id="textfield5" value="<?php

$s=$num1+$num2+$num4;

echo "el total es $s";

?>">

</p>

<p>

<label for="textfield6">RESTA:</label>

<input type="text" name="r" id="textfield6" value="<?php

$r=$num1-$num2-$num4;

echo "el total es $r";

?>">

</p>

<p>

<label for="textfield7">MULTIPLICACION:</label>

<input type="text" name="multi" id="textfield7" value="<?php

$multi=$num1*$num2*$num4;

echo "el total es $multi";

?>">

</p>

<p>

<label for="textfield8">DIVISION:</label>

<input type="text" name="d" id="textfield8" value="<?php

$d=$num1/$num2/$num4;
TAREA 1 PHP
Debora Sales 5to. Comercial
echo "el total es $d";

?>">
TAREA 1 PHP
Debora Sales 5to. Comercial
CODIGO PROGRAMA 3:
<title>Numero Mayor y Menor</title>

</head>

<body>

<form id="form1" name="form1" method="post">

<p>

<label for="textfield">INGRESE PRIMER NUMERO:</label>

<input type="text" name="n1" id="textfield">

</p>

<p>

<label for="textfield2">INGRESE SEGUNDO NUMERO:</label>

<input type="text" name="n2" id="textfield2">

</p>

<p>

<label for="textfield3">INGRESE TERCER UN NUMERO:</label>

<input type="text" name="n3" id="textfield3">

</p>

<p>

<input type="submit" name="submit" id="submit" value="Enviar">

</p>

<p>

<label for="textfield4">resultado:</label>

<input type="text" name="textfield4" id="textfield4" value="<?php if ($n1>$n2 && $n1>$n3)

echo "PRIMERO MAYOR ";

elseif ($n2>$n1 && $n2>$n3)

echo "segundo mayo";

elseif($n3>$n1 && $n3>$n2)


TAREA 1 PHP
Debora Sales 5to. Comercial
echo "TERCERO MAYOR";

else

echo "son iguales ";

?>">

You might also like