Advertisement
WallHero

TP04E05 Paciente

Oct 30th, 2020
1,893
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.63 KB | None | 0 0
  1. package tp;
  2.  
  3. import java.util.Date;
  4.  
  5. public class Paciente {
  6.    
  7.     private String nombre;
  8.     private String apellido;
  9.     private String sexo;
  10.     private int edad;
  11.     private String servicio;
  12.     private String domicilio;
  13.     private Date fecha;
  14.    
  15.     public Paciente(String nombre, String apellido, String sexo, int edad, String servicio, String domicilio, Date fecha) {
  16.         this.nombre = nombre;
  17.         this.apellido = apellido;
  18.         this.sexo = sexo;
  19.         this.edad = edad;
  20.         this.servicio = servicio;
  21.         this.domicilio = domicilio;
  22.         this.fecha = fecha;
  23.     }
  24.    
  25.     public Paciente() {
  26.        
  27.     }
  28.  
  29.     @Override
  30.     public String toString() {
  31.         return "\n\nPaciente:\n  Nombre: " + getNombre() + "\n  Apellido: " + getApellido() + "\n  Edad: " + getEdad()
  32.                 + "\n  Domicilio" + getDomicilio() + "\n  Sexo: " + getSexo() + "\n  Servicio: " + getServicio() + "\nFecha: " + getFecha().toString();
  33.     }
  34.  
  35.     String getNombre() {
  36.         return nombre;
  37.     }
  38.  
  39.     void setNombre(String nombre) {
  40.         this.nombre = nombre;
  41.     }
  42.  
  43.     String getApellido() {
  44.         return apellido;
  45.     }
  46.  
  47.     void setApellido(String apellido) {
  48.         this.apellido = apellido;
  49.     }
  50.  
  51.     int getEdad() {
  52.         return edad;
  53.     }
  54.  
  55.     void setEdad(int edad) {
  56.         this.edad = edad;
  57.     }
  58.  
  59.     String getDomicilio() {
  60.         return domicilio;
  61.     }
  62.  
  63.     void setDomicilio(String domicilio) {
  64.         this.domicilio = domicilio;
  65.     }
  66.  
  67.     String getSexo() {
  68.         return sexo;
  69.     }
  70.  
  71.     void setSexo(String sexo) {
  72.         this.sexo = sexo;
  73.     }
  74.  
  75.     String getServicio() {
  76.         return servicio;
  77.     }
  78.  
  79.     void setServicio(String servicio) {
  80.         this.servicio = servicio;
  81.     }
  82.  
  83.     Date getFecha() {
  84.         return fecha;
  85.     }
  86.  
  87.     void setFecha(Date fecha) {
  88.         this.fecha = fecha;
  89.     }
  90. }
  91.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement