Vous êtes sur la page 1sur 5

SUELDO

<?php

//variables

$n1=0; $n2=0; $s=0;

if(isset($_POST["btncalcular"])){

//entrada

$n1=(int)$_POST["txtn1"];

$n2=(int)$_POST["txtn2"];

//proceso

$s=($n1*20+$n2*30);

?>

<html>

<head><title>Sueldo de un trabajador</title>

</head>

<body>

<form method="post" action="problema00001.php">

<table width="241"border="0">

<tr><strong>Sueldo de un trabajador</strong></tr>

<tr>

<td width="81">Horas Normales </td>

<td width="150">

<input
name="txtn1"type="text"id="txtn1"value="<?=$n1?>"/> </td>

</tr>

<tr>

<td>Horas Extras</td>

<td>

<input name="txtn2"
type="text"id="txtn2"value="<?=$n2?>"/></td>

</tr>
<tr>

<td>Sueldo</td>

<td>

<input
name="txts"type="text"id="txts"value="<?=$s?>"/></td>

</tr>

<tr>

<td>&nbsp;</td>

<td>

<input
name="btncalcular"type="submit"id="btncalcular"

value="calcular"/> </td>

</tr>

</table>

</form>

</body>

</html>

ECUACION

<?php

//variables

$a=0;$b=0;$x=0;

if(isset($_POST["btnCalcular"])) {

//Entrada

$a=(int)$_POST["txta"];

$b=(int)$_POST["txtb"];

//proceso

$x=(3*$b)/$a;

?>

<html>

<head><title>Ecuacion</title>
</head>

<body>

<form method="Post" action="problema00002.php">

<table width="241"border="0">

<tr><strong>Ecuacion</strong></tr>

<tr>

<td width="81">Valor de a</td>

<td width="150">

<input name="txta" type="text" id="txta" value="<?=$a?>" /> </td>

</tr>

<tr>

<td>Valor de b</td>

<td>

<input name="txtb" type="text" id="txtb" value="<?=$b?>"/></td>

</tr>

<tr>

<td>Valor de x</td>

<td>

<input name="txtx" type="text" id"txtx" value="<?=$x?>"/></td>

</tr>

<tr>

<td>&nbsp;</td>

<td>

<input name="btnCalcular" type="submit" id="btnCalcular" value="Calcular" /></td>

</tr>

</table>

</form>

</body>

</html>
AREA DE LA FIGURA

<?php

//variables

$a=0; $B=0;$b=0;$h=0;

if(isset($_POST["btncalcular"])){

//entrada

$B=(float)$_POST["txtB"];

$b=(float)$_POST["txtb"];

$h=(float)$_POST["txth"];

//proceso

$a=($B+$b)/2*$h;

?>

<html>

<head>

<title>Area de la figura</title>

</head>

<body>

<form method="post"action="problema00003.php">

<table width="217"border="0">

<tr>

<td colspan="2"><strong>Area de la figura</strong></td>

</tr>

<tr>

<td width="55">Base Mayor</td>

<td width="152">

<input name="txtB"type="text"id="txtB"value="<?=$B?>"/> </td>

</tr>

<tr>

<td>Base Menor</td>

<td>
<input name="txtb"type="text"id="txtb"value="<?=$b?>"/> </td>

</tr>

<tr>

<td>Altura</td>

<td>

<input name="txth"type="text"id="txth"value="<?=$h?>"/> </td>

</tr>

<tr>

<td>Area</td>

<td>

<input name="txta"type="text"id="txta"value="<?=$a?>"/> </td>

</tr>

<tr>

<td>&nbsp;</td>

<td>

<input name="btncalcular"type="submit"id="btncalcular"

value="calcular"/> </td>

</tr>

</table>

</form>

</body>

</html>

Vous aimerez peut-être aussi