INFORME
ESTUDIANTE: Lenin Mateo Quishpe Chanataxi SEMESTRE: Tercero
PARALELO : “C” PRÁCTICA #3
TEMA:
Tarea con for y while.
OBJETIVO:
Realizar las actividades con el uso del for y del while.
RESULTADOS DE APRENDIZAJE
-Comprensión del uso del for y del while.
-Uso correcto de variables que aplicaremos en Php.
-Desarrollar bien los ejercicios planteados.
ACTIVIDADES:
-Realizar un ejercicio en php que despliegue las tablas de multiplicar.
-Si ingresa un número que no corresponde a los reales imprimir error.
DESARROLLO DE CONTENIDOS
1) Abrir php y guardar en nuestra carpeta de nuestro localhost como php
2) Abrir nuestro local server y ingresar a nuestro localhost en ejercicios para poder visualizar nuestro
avance
3) Asignar código con variables con for y while
4) Comprobar nuestra información en nuestro localhost nuestra tabla con los ejercicios realizados
5) Códigos de los programas.
FOR
<html>
<head>
<link rel="stylesheet" href="style1.css">
</head>
<style type="text/css">
</style>
<form action="#" method="POST">
INGRESE EL NÚMERO <br> <br> <input type="number" name="a" value="" /><br><br>
<input type="submit" value="CALCULAR "> <br>
<br>
<?php
if (!empty($_POST["a"]))
{
$b= $_POST['a'];
for ($i=1 ; $i<=10; $i++)
{
$res=$b*$i;
echo $b. "*" .$i. "=" .$res."<br>" ;
}
}
?>
</html>
WHILE
<html>
<head>
<link rel="stylesheet" href="style1.css">
</head>
<style type="text/css">
</style>
<br>
<HR WIDTH= 100% COLOR=BLACK>
<form action="#" method="POST">
INGRESE <input type="number" name="a" value="" />
<input type="submit" value="CALCULAR "> <br>
<br>
<?php
if (!empty($_POST["a"]))
{
$b= $_POST['a'];
$i=1;
while( $i<=10)
{
$res=$b*$i;
echo $b. "*" .$i. "=" .$res."<br>";
$i++;
}
}
?>
</html>
f.)
____ _______ f.) __________________
MSc. Víctor Zapata
ESTUDIANTE DOCENTE

Tabla de multiplicar con for y while

  • 1.
    INFORME ESTUDIANTE: Lenin MateoQuishpe Chanataxi SEMESTRE: Tercero PARALELO : “C” PRÁCTICA #3 TEMA: Tarea con for y while. OBJETIVO: Realizar las actividades con el uso del for y del while. RESULTADOS DE APRENDIZAJE -Comprensión del uso del for y del while. -Uso correcto de variables que aplicaremos en Php. -Desarrollar bien los ejercicios planteados. ACTIVIDADES: -Realizar un ejercicio en php que despliegue las tablas de multiplicar. -Si ingresa un número que no corresponde a los reales imprimir error. DESARROLLO DE CONTENIDOS 1) Abrir php y guardar en nuestra carpeta de nuestro localhost como php 2) Abrir nuestro local server y ingresar a nuestro localhost en ejercicios para poder visualizar nuestro avance
  • 2.
    3) Asignar códigocon variables con for y while
  • 3.
    4) Comprobar nuestrainformación en nuestro localhost nuestra tabla con los ejercicios realizados
  • 4.
    5) Códigos delos programas. FOR <html> <head> <link rel="stylesheet" href="style1.css"> </head> <style type="text/css"> </style> <form action="#" method="POST"> INGRESE EL NÚMERO <br> <br> <input type="number" name="a" value="" /><br><br> <input type="submit" value="CALCULAR "> <br> <br> <?php if (!empty($_POST["a"])) { $b= $_POST['a']; for ($i=1 ; $i<=10; $i++) { $res=$b*$i; echo $b. "*" .$i. "=" .$res."<br>" ; } } ?> </html>
  • 5.
    WHILE <html> <head> <link rel="stylesheet" href="style1.css"> </head> <styletype="text/css"> </style> <br> <HR WIDTH= 100% COLOR=BLACK> <form action="#" method="POST"> INGRESE <input type="number" name="a" value="" /> <input type="submit" value="CALCULAR "> <br> <br> <?php if (!empty($_POST["a"])) { $b= $_POST['a']; $i=1; while( $i<=10) { $res=$b*$i; echo $b. "*" .$i. "=" .$res."<br>"; $i++; } } ?> </html>
  • 6.
    f.) ____ _______ f.)__________________ MSc. Víctor Zapata ESTUDIANTE DOCENTE