Advertisement
Guest User

Untitled

a guest
Jun 19th, 2019
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.88 KB | None | 0 0
  1. package intendo2;
  2.  
  3. import java.io.Serializable;
  4. public class Alumno extends Persona implements Serializable {
  5. int edad;
  6. int calificacion;
  7.  
  8. public Alumno(int id, String nombre, String apellidoPaterno, String apellidoMaterno, String correo, int edad, int calificacion){
  9. super(id, nombre, apellidoPaterno, apellidoMaterno, correo);
  10. this.edad = edad;
  11. this.calificacion = calificacion;
  12. }
  13.  
  14. public Alumno(){
  15. super(69420, "Andres", "Abimeri", "Romero", "andres.abimeri@gmail.com" );
  16. this.edad = 20;
  17. this.calificacion = 69;
  18. }
  19.  
  20. @Override
  21. public String toString() {
  22. return "Alumno{" + "edad=" + edad + ", calificacion=" + calificacion + '}';
  23. }
  24.  
  25. package intendo2;
  26.  
  27. import java.io.Serializable;
  28.  
  29.  
  30. public class Profesor extends Persona implements Serializable{
  31. String titulo;
  32.  
  33.  
  34.  
  35.  
  36. public Profesor (int id, String nombre, String apellidoPaterno, String apellidoMaterno, String correo, String titulo){
  37. super(id, nombre, apellidoPaterno, apellidoMaterno, correo);
  38. this.titulo = titulo;
  39. }
  40.  
  41.  
  42. public Profesor(){
  43. super(69420, "Andres", "Abimeri", "Romero", "andres.abimeri@gmail.com" );
  44. this.titulo = "Ing. en Informática";
  45. }
  46.  
  47. @Override
  48. public String toString() {
  49. return "Profesor{" + "titulo=" + titulo + '}';
  50. }
  51.  
  52. package intendo2;
  53. import java.util.ArrayList;
  54. import java.io.Serializable;
  55.  
  56. public class Materia implements Serializable {
  57. int id;
  58. String nombre;
  59.  
  60. ArrayList<Alumno> alumnos = new ArrayList<Alumno>();
  61. ArrayList<Profesor> profesores = new ArrayList<Profesor>();
  62.  
  63.  
  64. public Materia(int id, String nombre){
  65. this.id = id;
  66. this.nombre = nombre;
  67. }
  68.  
  69. public Materia(){
  70. this.id = 55555;
  71. this.nombre = "Materia Generica";
  72. }
  73.  
  74. @Override
  75. public String toString() {
  76. return "Materia{" + "id=" + id + ", nombre=" + nombre + ", alumnos=" + alumnos + ", profesores=" + profesores + '}';
  77. }
  78.  
  79. static ArrayList<Materia> materias = new ArrayList<>();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement