Está en la página 1de 2

// Además de los atributos de persona, tiene el siguiente atributo:

private double salario; // Salario Mensual Nominal.

// Implementen abajo Constructor, Getter, Setter, toString() y el

// método public char obtenerNivel()() -->

// -----------------------------------------------------------

public Trabajador(double salario, int tipo, String apellidos, String nombres, int cedula, String tel,
double puntaje) {

super(tipo, apellidos, nombres, cedula, tel, puntaje);

this.salario = salario;

// -----------------------------------------------------------

public double getSalario() {

return salario;

public void setSalario(double salario) {

this.salario = salario;

@Override

public char obtenerNivel() {

if(4.0<=this.getPuntaje() && this.getPuntaje()<=5){

return 'A';

}else if(3.5<=this.getPuntaje() && this.getPuntaje()<4.0){

return 'B';
}else if(3.0<=this.getPuntaje() && this.getPuntaje()<3.5){

return 'C';

}else{

return 'D';

@Override

public String mostrarDatos(){

return "Los nombres y apellidos del trabajador son: " + nombres + " " + apellidos + " Su
puntaje fue: " + puntaje

+ " Su telefono y cedula son respectivamente " + tel + " y " + cedula + ", Salario: " +
salario;

@Override

public String ajustarValor() {

String msj = "No se obtuvo el nivel suficiente para ajustar el valor";

if(this.obtenerNivel() == 'A'){

msj = "Valor ajustado a " + nombreC +"\t"+ (this.getSalario()*1.04);

return msj;

También podría gustarte