4° UNIDAD 2 SALUD,ALIMENTACIÓN Y DÍA DE LA MADRE (1) (3).pdf
Cheque
1. UNIVERSIDAD CENTRAL DEL ECUADOR
F FACULTAD DE FILOSOFÍA, LETRAS Y CIENCIAS DE LA EDUCACIÓN
PEDAGOGÍA DE LAS CIENCIAS EXPERIMENTALES DE LA
INFORMÁTICA
PROGRAMACIÓN ORIENTADA A OBJETOS
INTEGRANTES
Jazmín Quinatoa
Guamán Oliver
Mateo Quishpe
PARALELO:
3 “C”
DOCENTE:
MSc. Víctor Zapata
FECHA:
12 – 8 – 2021
2. GUÍA DE USO DE LABORATORIOS
TEMA:
Array
OBJETIVO:
Trabajar con la herramienta Visual Studio Code, utilizando el programa xampp como
administrador, en el cual deberemos realizar un ejercicio en php.
RESULTADOS DE APRENDIZAJE
Comprensión del software Visual Studio Code.
Utilizar de forma correcta los vectores.
ACTIVIDADES:
- Trabajar con el software Visual Studio Code.
- Realizar un ejercicio tipo cheuque en php que permita ingresar una cantidad en
números y despliegue la cantidad en letras.
DESARROLLO DE CONTENIDOS
CODIGO DEL PROGRAMA:
<!DOCTYPE html>
<html>
<link rel="stylesheet" type="text/css" href="estilos.css">
<body background="unnamed (1).jpg">
<center>
<form action="#" method="POST">
<center><h1>CHEQUE</h1></center>
3. <center><img src="cheque-partes.jpg" height="30%" width="30%"></center>
<br>
INGRESE EL MONTO EN NÚMEROS = <input type="number" name="numero" value=
"" /><br><br>
<input type="submit" value="CANTIDAD EN LETRAS "> <br>
<br>
<br>
<?php
function unidades ($num) {
$valor = array ('uno','dos','tres','cuatro','cinco','seis','siete','och
o',
'nueve','diez', 'once', 'doce','trece','catorce',
'quince','dieciseis','diecisiete','dieciocho',
'diez y nueve','veinte','veinte y uno',
'veinte y dos','veinte y tres',
'veinte y cuatro','veinte y cinco',
'veinte y seis','veinte y siete','veinte y ocho','veinte y nueve');
return $valor[$num - 1];
}
function decenas($n) {
$decenas = array ( 20=>'veinte', 30=>'treinta',40=>'cuarenta',50=>'cinc
uenta',60=>'sesenta',
70=>'setenta',80=>'ochenta',90=>'noventa');
if( $n <= 9) return unidades ($n);
$x = $n % 10;
if ( $x == 0 ) {
return $decenas[$n];
} else return $decenas[$n - $x].' y '. unidades ($x);
}
function centenas($n) {
$cientos = array (100 =>'cien',200 =>'doscientos',300=>'trecientos',
400=>'cuatrocientos', 500=>'quinientos',600=>'seiscientos',
700=>'setecientos',800=>'ochocientos', 900 =>'novecientos');
if( $n >= 100) {
if ( $n % 100 == 0 ) {
return $cientos[$n];
} else {
$u = (int) substr($n,0,1);
$d = (int) substr($n,1,2);
return (($u == 1)?'ciento':$cientos[$u*100]).' '.decenas($d);
}
} else return decenas($n);
}