-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.js
27 lines (19 loc) · 783 Bytes
/
app.js
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
// Importaciones necesarias
const readLineSync = require('readline-sync');
const {mostrarListaEstudiantes} = require('./lista_estudiantes.js');
const registrarEstudiantes = () => {
const cantidadEstudiates = readLineSync.question('Ingrese la cantidad de estudiantes a registrar: ');
const estudiantes = [];
for (let i = 0; i < cantidadEstudiates; i++) {
const nombre = readLineSync.question(`Ingrese el nombre del estudiante ${i + 1}: `);
const edad = readLineSync.question(`Ingrese la edad del estudiante ${nombre}: `);
const estudiante = {
nombre,
edad
};;
estudiantes.push(estudiante);
}
mostrarListaEstudiantes(estudiantes);
};
// Iniciar registro de estudiantes
registrarEstudiantes();