-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtp3_ej8-Main
More file actions
76 lines (72 loc) · 2.67 KB
/
tp3_ej8-Main
File metadata and controls
76 lines (72 loc) · 2.67 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Main.java to edit this template
*/
package alumnos;
import java.util.Scanner;
/**
*
* @author Usuario
*/
public class Alumnos {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int cant,aux;
String auxS;
System.out.print("Cuantos alumnos a distancia desea agregar? ");
cant = sc.nextInt();
Fecha auxFecha = new Fecha();
EstudianteADistancia es[] = new EstudianteADistancia[cant];
for(int i = 0;i<cant;i++){
es[i] = new EstudianteADistancia();
System.out.println("---------- Estudiante n°" + i + " ----------");
System.out.print("Ingrese el nombre del estudiante: ");
auxS = sc.next();
sc.nextLine();
es[i].setNombre(auxS);
System.out.print("Ingrese el dia de nacimiento: ");
aux = sc.nextInt();
auxFecha.setDia(aux);
System.out.print("Ingrese el mes de nacimiento: ");
aux = sc.nextInt();
auxFecha.setMes(aux);
System.out.print("Ingrese el año de nacimiento: ");
aux = sc.nextInt();
auxFecha.setAnio(aux);
es[i].setFecha(auxFecha);
System.out.print("Ingrese el estado civil: ");
auxS = sc.next();
sc.nextLine();
es[i].setEstadoCivil(auxS);
System.out.print("Ingrese el DNI: ");
aux = sc.nextInt();
es[i].setNumDocumento(aux);
System.out.print("Ingrese la carrera a la que se inscribió: ");
auxS = sc.next();
sc.nextLine();
es[i].setCarrera(auxS);
System.out.print("Ingrese el año del cursado: ");
aux = sc.nextInt();
es[i].setAnioCursada(aux);
System.out.print("Ingrese el usuario: ");
auxS = sc.next();
sc.nextLine();
es[i].setUsuario(auxS);
System.out.print("Ingrese la contraseña: ");
auxS = sc.next();
sc.nextLine();
es[i].setContraseña(auxS);
System.out.print("Ingrese la ciudad del estudiante: ");
auxS = sc.next();
sc.nextLine();
es[i].setCiudad(auxS);
}
System.out.println("--------------------------- TODOS LOS ESTUDIANTES ---------------------------");
for(int i = 0; i < cant; i++){
System.out.println(es[i]);
}
}
}