forked from aldasole/Proyecto_java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProyecto
More file actions
141 lines (128 loc) · 4.75 KB
/
Copy pathProyecto
File metadata and controls
141 lines (128 loc) · 4.75 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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
package proyecto;
import LeerArchivos.LeerCuenta;
import LeerArchivos.LeerCurso;
import LeerArchivos.LeerEstudiante;
import LeerArchivos.LeerProfesor;
import objetos.Curso;
import objetos.Profesor;
import objetos.Cuenta;
import objetos.Estudiante;
import java.util.LinkedList;
import java.util.Scanner;
/**
* @author Ariana Ochoa
* @author Karina Sailema
* @author Aldair Soledispa
* la clase principal del programa
*/
public class Proyecto {
/**
* @param args the command line arguments
*/
public static Cuenta c1;
public static void main(String[] args) {
LeerCuenta usuario = new LeerCuenta();
Planificador profesor = new Planificador();
Alumno alumno = new Alumno();
boolean band,band1=true;
int opcion = 0;
Curso curso;
LeerCurso leerCurso = new LeerCurso();
LeerProfesor leerProfe = new LeerProfesor();
LeerEstudiante leerEstu = new LeerEstudiante();
Scanner scan = new Scanner(System.in);
System.out.println("\n****************************");
System.out.println("** **");
System.out.println("** HOGWARTS **");
System.out.println("** BIENVENIDOS **");
System.out.println("** **");
System.out.println("****************************");
c1=usuario.leerCuenta();
while (band1){
if(c1.rol.equals("planificador")){
System.out.println("\n1. Crear Curso");
System.out.println("2. Crear Profesor");
System.out.println("3. Crear Estudiante");
System.out.println("4. Ver Horarios Planificados");
System.out.println("5. Listado de estudiantes");
System.out.println("6. Salir\n");
band=true;
while(band){
System.out.print("Escoga una opción: ");
Scanner op = new Scanner(System.in);
opcion=op.nextInt();
if(opcion>=7){
System.out.println("ERROR: Escoga una opción correcta\n");
}else{
band=false;
}
}
switch(opcion){
case 1:
curso=profesor.crearCurso();
if(curso==null){
System.out.println("No ha guardado el curso");
}else{
leerCurso.guardarCurso(curso);
}
break;
case 2:
Profesor profes=profesor.crearProfesor();
if(profes==null){
System.out.println("No ha guardado el profesor");
}else{
leerProfe.guardarProfesor(profes);
}
break;
case 3:
Estudiante estudiante=profesor.crearEstudiante();
if(estudiante==null){
System.out.println("No ha guardado el Estudiante");
}else{
leerEstu.guardarEstudiante(estudiante);
}
break;
case 4:
profesor.horario();
break;
case 5:
profesor.listado();
break;
case 6:
band1=false;
break;
}
}else {
System.out.println("\n1. Ver Cursos Planificados");
System.out.println("2. Registro");
System.out.println("3. Descripción de vuelo");
System.out.println("4. Salir\n");
band=true;
while(band){
System.out.print("Escoga una opción: ");
Scanner op = new Scanner(System.in);
opcion=op.nextInt();
if(opcion>=5){
System.out.println("ERROR: Escoga una opción correcta\n");
}else{
band=false;
}
}
switch(opcion){
case 1:
alumno.planificacion();
break;
case 2:
alumno.registro();
break;
case 3:
alumno.volar(alumno.tipo());
break;
case 4:
band1=false;
break;
}
}
}
}
}