Sunteți pe pagina 1din 2

package examenJunio;

import java.io.Serializable;
import java.util.Calendar;

public class Presencial extends Alumno implements Comparable<Alumno>, Serializable{

String telefono;
double SEGURO_ESCOLAR=300;
double GASTOS_ADMTVOS=150;

public Presencial(String nif, String nombre, String apellido, Calendar fechNac,


boolean familianumerosa,
Ciclo ciclo, double mATRICULA, String telefono, double sEGURO_ESCOLAR,
double gASTOS_ADMTVOS) {

super(nif, nombre, apellido, fechNac, familianumerosa, ciclo, mATRICULA);


this.telefono = telefono;
SEGURO_ESCOLAR = sEGURO_ESCOLAR;
GASTOS_ADMTVOS = gASTOS_ADMTVOS;

public String getTelefono() {


return telefono;
}

public void setTelefono(String telefono) {


this.telefono = telefono;
}

public double getSEGURO_ESCOLAR() {


return SEGURO_ESCOLAR;
}

public void setSEGURO_ESCOLAR(double sEGURO_ESCOLAR) {


SEGURO_ESCOLAR = sEGURO_ESCOLAR;
}

public double getGASTOS_ADMTVOS() {


return GASTOS_ADMTVOS;
}

public void setGASTOS_ADMTVOS(double gASTOS_ADMTVOS) {


GASTOS_ADMTVOS = gASTOS_ADMTVOS;
}
public double calcularMatricula() {

long milisegundos=Calendar.getInstance().getTimeInMillis()-
fechNac.getTimeInMillis();
long edad=milisegundos/(1000*60*60*24);
edad=(edad/30)/12;

if(edad>=40) {
return 0+this.GASTOS_ADMTVOS+this.SEGURO_ESCOLAR;
}
if (familianumerosa==true) {
return( MATRICULA*0.5)+this.GASTOS_ADMTVOS+this.SEGURO_ESCOLAR;
}

return MATRICULA+this.GASTOS_ADMTVOS+this.SEGURO_ESCOLAR;
}

@Override
public String toString() {
return "Modalidad Presencial:"+super.toString()+" Telefono: "+getTelefono();
}

S-ar putea să vă placă și