forked from Romero-Ezequiel/NodeJs
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathej101.js
More file actions
executable file
·38 lines (34 loc) · 1.16 KB
/
ej101.js
File metadata and controls
executable file
·38 lines (34 loc) · 1.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/**
* Ejercicio 101
Crear un documento con el nombre ej101.js
Declarar una función que muestre los siguientes datos en consola:
Tu Nombre
Edad
Teléfono
Calle
Altura
Código postal
Casado true/false
*/
const datos = () =>{
let nombre, edad, tel, calle, altura, codig, casad;
nombre = prompt('Ingrese tu nombre ');
edad = prompt('Ingrese tu edad ');
tel = prompt('Ingrese tu telefono ');
calle = prompt('Ingrese tu calle en donde vives ');
altura = prompt('Ingrese la altura de donde vives ');
codig = prompt('Ingrese el codigo postal ');
const comprobar = () =>{
casad = prompt('Ingrese true si estas casado sino false');
switch(casad){
case 'true': return 'esta casado';break;
case 'false': return 'no esta casado';break;
default: return 'incorrecto';break;
}
}
document.write(`Tu nombre es: ${nombre}, su edad ${edad} años,
su telefono ${tel}, su calle en donde vives ${calle},
su altura ${altura}, su codigo postal ${codig}, su
estado civil es ${comprobar()} `);
}
datos();