-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEscuela.ch
105 lines (97 loc) · 2.53 KB
/
Escuela.ch
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
class Persona {
visible string nombre;
visible numeral edad;
visible Persona: madre;
visible Persona: padre;
visible string getNombre() {
return this.nombre;
}
visible without setNombre(string nom) {
this.nombre = nom;
}
visible numeral getEdad() {
return this.edad;
}
visible without setEdad(numeral ed) {
this.edad = ed;
}
visible real getMadre() {
return this.madre;
}
visible without setMadre(real mad, numeral prof) {
madre.edad = prof;
}
visible string getPadre() {
return this.padre;
}
visible without setPadre(string pad) {
this.nombre = pad;
}
}
class Profesor under Persona {
visible string materia;
hidden numeral a;
visible string nambre;
hidden string getMateria() {
a = getEdad();
return this.materia;
}
visible without setMateria(string mat) {
this.materia = mat;
}
}
class Estudiante under Profesor {
visible real calificacion;
visible Profesor: profe;
visible real getCalif() {
return this.calificacion;
}
visible without setCalif(real calif) {
this.calificacion = calif;
}
visible numeral getProfesor() {
profe.materia = getMateria();
profe.nombre = profe.getPadre();
profe.nombre = getMateria();
return this.profe;
}
visible without setProfesor(char pro) {
}
}
class main {
hidden numeral cont = 0;
visible Persona: mama, papa;
hidden Persona: arrP[2];
visible Profesor: profe;
hidden Estudiante: yo;
hidden string nombreProfe = "no lo se", nombre;
visible numeral miEdad;
visible without main() {
mama.setNombre("Laura");
mama.setEdad(45);
papa.setNombre("Pedro");
papa.setEdad(45);
arrP[0] = mama;
arrP[1] = papa;
profe.setNombre("Elda");
profe.setMateria("Compiladores");
yo.setNombre("Manolo");
yo.setEdad(20);
yo.setProfesor('c');
if (nombreProfe == "Ra ul" && 2 > 2) {
output("La materia que da mi Profe es:");
}
else if (yo.getEdad() >= 30) {
output("Esta es mi verdadera edad: 5");
input(miEdad);
output( (miEdad*8-5)*2 < 0 && true);
}
else {
output( mama.edad );
}
while(cont < 15){
output(papa.edad);
cont = cont + 1;
}
}
}