Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////// Estudiante ///////////////////////////////////////////////////
- class Estudiante extends Usuario {
- //Atributos
- protected String programa;
- protected String carnet;
- //Constructor
- public Estudiante(String nombre, String apellidos, boolean sancion, String correo, String programa, String carnet) {
- super(nombre, apellidos, sancion, correo);
- this.programa = programa;
- this.carnet = carnet;
- }
- }
- /////////////////////////////////////// Externo //////////////////////////////////////////////
- class Externo extends Usuario{
- //Atributos
- protected String Institucion;
- protected String carnetExt;
- public Externo(String nombre, String apellidos, boolean sancion, String correo, String Institucion, String carnetExt) {
- super(nombre, apellidos, sancion, correo);
- this.Institucion = Institucion;
- this.carnetExt = carnetExt;
- }
- }
- ////////////////////////////////////// Profesor ////////////////////////////////////////////////
- class Profesor extends Usuario {
- //Atributos
- protected String IdProfesor;
- public Profesor(String nombre, String apellidos, boolean sancion, String correo, String IdProfesor) {
- super(nombre, apellidos, sancion, correo);
- this.IdProfesor = IdProfesor;
- }
- }
- ///////// USUARIO (para pruebas porque la clase Usuario definitiva es de Mery) //////////////////
- public abstract class Usuario {
- //Atributos
- protected String nombre;
- protected String apellidos;
- protected boolean sancion;
- protected String correo;
- //Constructor
- public Usuario(String nombre, String apellidos, boolean sancion, String correo){
- this.nombre = nombre;
- this.apellidos = apellidos;
- this.sancion = sancion;
- this.correo = correo;
- }
- public static void main (String [] args){
- //Usuarios por defecto:
- Estudiante E1 = new Estudiante("Pedro","Ramírez",false,"[email protected]","Ingeniería Administrativa","001");
- Estudiante E2 = new Estudiante("Andres","Ochoa",false,"[email protected]","Ingeniería Mecánica","002");
- Externo EX1 = new Externo("Andrea","Muñoz",false,"[email protected]","Universidad de Antioquia","003");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment