Skip to content

Commit f9ede71

Browse files
committed
20240527 Creacion carpeta PruebasEntregas
1 parent 0e2d2f7 commit f9ede71

File tree

6 files changed

+174
-42
lines changed

6 files changed

+174
-42
lines changed

Clase 6/PruebasArrays.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//SEGUNDA ENTREGA
2+
//ARRAY
3+
4+
/**
5+
* PIDE INGRESAR LOS DATOS DE PERSONAS EN UN ARRAY
6+
*
7+
*/
8+
9+
//CREO MATRIZ
10+
11+
//PIDE INGRESAR LOS DATOS AL ARRAY
12+
13+
let head = ['Nombre', 'Apellido','Cedula'];
14+
let x = head.length; //Cuenta los datos a solicitar (Array "head")
15+
let matriz=[]; //Crea natriz vacia "matriz"
16+
17+
//USANDO FOR
18+
/* for (let i = 0; i < x; i++) {
19+
dato=prompt("Ingrese "+head[i]+": ");
20+
matriz.push([head[i],dato]);
21+
} */
22+
//console.log(matriz);
23+
24+
25+
// USANDO FOR..OF
26+
for (let d of head) {
27+
dato=prompt("Ingrese "+d+": ");
28+
matriz.push([d,dato]);
29+
}
30+
console.log(matriz);

Entregas/Entrega2/ArraysConFor.js

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
//SEGUNDA ENTREGA
2+
//ARRAY
3+
4+
/**
5+
* PIDE INGRESAR LOS DATOS DE PERSONAS EN UN ARRAY
6+
*
7+
*/
8+
9+
//CREO MATRIZ
10+
11+
//PIDE INGRESAR LOS DATOS AL ARRAY
12+
13+
let head = ['Nombre', 'Apellido','Cedula'];
14+
let x = head.length; //Cuenta los datos a solicitar (Array "head")
15+
let matriz=[]; //Crea natriz vacia "matriz"
16+
17+
//USANDO FOR
18+
/* for (let i = 0; i < x; i++) {
19+
dato=prompt("Ingrese "+head[i]+": ");
20+
matriz.push([head[i],dato]);
21+
} */
22+
//console.log(matriz);
23+
24+
25+
// USANDO FOR..OF
26+
for (let d of head) {
27+
dato=prompt("Ingrese "+d+": ");
28+
matriz.push([d,dato]);
29+
}
30+
console.log(matriz);

Entregas/Entrega2/index.html

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,34 +3,10 @@
33
<head>
44
<meta charset="UTF-8">
55
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6-
<link rel="stylesheet" href="./estilos.css" type="text/css">
76
<script async src="./index.js"></script>
8-
<title>ENTREGA 01</title>
7+
<title>ENTREGA 2 ARRAYS</title>
98
</head>
10-
119
<body>
12-
13-
<div id="contenedor">
14-
<div id="central">
15-
<div id="login">
16-
<div class="titulo">
17-
Acceso Usuario
18-
</div>
19-
<form id="loginform">
20-
<input type="text" name="usuario" placeholder="Usuario" required>
21-
22-
<input type="password" placeholder="Contrasena" name="password" required>
23-
24-
<button type="submit" title="Ingresar" name="Ingresar">Login</button>
25-
</form>
26-
<div class="pie-form">
27-
No tienes usuario?<a href="#">Registrate</a>
28-
</div>
29-
</div>
30-
<div class="inferior">
31-
<a href="#">Inicio</a>
32-
</div>
33-
</div>
34-
</div>
10+
<p>ENTREGA 2 : ARRAYS</p>
3511
</body>
3612
</html>

Entregas/Entrega2/index.js

Lines changed: 62 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,69 @@
1-
//SEGUNDA ENTREGA
2-
//ARRAY
1+
//PRIMERA ENTREGA
2+
//Login basico usando una version con SWITCH y otra con sentencias IF, IF ELSE y WHILE
3+
4+
5+
6+
37

48
//-------------------------------------------------
5-
//FUNCION ingreso datos
9+
//Menu Inicial
610
//-------------------------------------------------
7-
/*
8-
function ingreso (){
9-
const lista = [ "Nombre: ", "Apellido: ", "Cedula: " ];
10-
console.log(lista.values); */
11+
let userdb=[]; //Crea natriz vacia "matriz"
12+
let log = true;
13+
while(log){
14+
let option = parseInt(prompt(" Opcion: \n 0. Login. \n 1.Salir \n 2.Registrarse"));
15+
switch(option){
16+
case 0:
17+
login();
18+
break;
19+
case 1:
20+
alert("Vuelva Pronto");
21+
log=false;
22+
break;
23+
case 2:
24+
registro();
25+
break;
26+
default:
27+
alert("Ingrese Opcion Correcta");
28+
break;
29+
}}
30+
31+
32+
console.log("Aqui continua el codigo ");
33+
34+
/**
35+
* FUNCION REGISTRO USUARIO
36+
*/
37+
38+
function registro (){
39+
40+
let head = ['Nombre', 'Apellido','Cedula','usuario','Password'];
41+
let x = head.length; //Cuenta los datos a solicitar (Array "head")
1142

12-
13-
/* for (let value of lista) {
14-
dato = prompt ("Ingrese :");
15-
value += 1;
16-
console.log(value);
17-
}*/
18-
/* }
43+
// USANDO FOR..OF
44+
for (let d of head) {
45+
dato=prompt("Ingrese "+d+": ");
46+
userdb.push([d,dato]);
47+
}
48+
return userdb;
49+
50+
}
51+
/**
52+
* FUNCION LOGIN USUARIO
53+
*/
54+
function login (){
55+
let user=prompt("Ingrese un Usuario: ");
56+
let indice = userdb.indexOf(user);//user es valor buscado en array userdb
57+
if (user==""){
58+
alert('No Ingreso nada');
59+
} else if (indice !== -1) {
60+
alert(`Valor encontrado en el índice ${indice}`);
61+
alert("BIENVENIDO AL SISTEMA ");
62+
log=false;//Para salir del while
63+
} else {
64+
alert("Debe ingresar usuario registrardo.");
65+
}
66+
}
1967

2068

2169

22-
ingreso();
23-
*/

Entregas/PruebasEntrega/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<script async src="./index.js"></script>
7+
<title>PRUEBAS ENTREGA </title>
8+
</head>
9+
<body>
10+
<p>PRUEBAS ENTREGAS</p>
11+
</body>
12+
</html>

Entregas/PruebasEntrega/index.js

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
2+
let userdb=[]; //Crea natriz vacia "matriz"
3+
4+
/**
5+
* FUNCION REGISTRO USUARIO
6+
*/
7+
8+
function registro (){
9+
10+
let head = ['Nombre', 'Apellido','Cedula','usuario','Password'];
11+
let x = head.length; //Cuenta los datos a solicitar (Array "head")
12+
13+
// USANDO FOR..OF
14+
for (let d of head) {
15+
dato=prompt("Ingrese "+d+": ");
16+
userdb.push([d,dato]);
17+
}
18+
return userdb;
19+
20+
}
21+
/**
22+
* FUNCION LOGIN USUARIO
23+
*/
24+
/* function login (){
25+
let user=prompt("Ingrese un Usuario: ");
26+
let indice = userdb.indexOf(user);//user es valor buscado en array userdb
27+
if (user==""){
28+
alert('No Ingreso nada');
29+
} else if (indice !== -1) {
30+
alert(`Valor encontrado en el índice ${indice}`);
31+
alert("BIENVENIDO AL SISTEMA ");
32+
log=false;//Para salir del while
33+
} else {
34+
alert("Debe ingresar usuario registrardo.");
35+
} */
36+
37+
38+
registro();

0 commit comments

Comments
 (0)