class Funcionario {
double salario;
void recebeAumento(double percentual) {
salario += salario / 100 * percentual;
}
public double calculaGanhoAnual() {
return salario * 13 + salario / 3;
}
public static void main
(String[] args
) { Funcionario f1 = new Funcionario();
f1.nome = "João";
f1.dep = "Defesa";
f1.banco = "Banco do Brasil S.A";
f1.RG = "798956-5";
f1.salario = 27000.0;
f1.recebeAumento(2000);
System.
out.
println("Nome: " + f1.
nome + "\nDepartamento: " + f1.
dep + "\nBanco: " + f1.
banco + "\nRG: " + f1.
RG + "\nSalário Anual: " + f1.
calculaGanhoAnual()); }
}
//https://pt.stackoverflow.com/q/227561/101
Y2xhc3MgRnVuY2lvbmFyaW8gewogICAgU3RyaW5nIG5vbWUsIGRlcCwgYmFuY28sIFJHOwogICAgZG91YmxlIHNhbGFyaW87CiAgICAKICAgIHZvaWQgcmVjZWJlQXVtZW50byhkb3VibGUgcGVyY2VudHVhbCkgewogICAgICAgIHNhbGFyaW8gKz0gc2FsYXJpbyAvIDEwMCAqIHBlcmNlbnR1YWw7CiAgICB9CiAgICBwdWJsaWMgZG91YmxlIGNhbGN1bGFHYW5ob0FudWFsKCkgewogICAgICAgICByZXR1cm4gc2FsYXJpbyAqIDEzICsgc2FsYXJpbyAvIDM7CiAgICB9CiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgRnVuY2lvbmFyaW8gZjEgPSBuZXcgRnVuY2lvbmFyaW8oKTsKICAgICAgICBmMS5ub21lID0gIkpvw6NvIjsKICAgICAgICBmMS5kZXAgPSAiRGVmZXNhIjsgICAgICAgIAogICAgICAgIGYxLmJhbmNvID0gIkJhbmNvIGRvIEJyYXNpbCBTLkEiOwogICAgICAgIGYxLlJHID0gIjc5ODk1Ni01IjsKICAgICAgICBmMS5zYWxhcmlvID0gMjcwMDAuMDsKICAgICAgICBmMS5yZWNlYmVBdW1lbnRvKDIwMDApOwogICAgICAgIFN5c3RlbS5vdXQucHJpbnRsbigiTm9tZTogIiArIGYxLm5vbWUgKyAiXG5EZXBhcnRhbWVudG86ICIgKyBmMS5kZXAgKyAiXG5CYW5jbzogIiArIGYxLmJhbmNvICsgIlxuUkc6ICIgKyBmMS5SRyArICJcblNhbMOhcmlvIEFudWFsOiAiICsgZjEuY2FsY3VsYUdhbmhvQW51YWwoKSk7CiAgICB9Cn0KCi8vaHR0cHM6Ly9wdC5zdGFja292ZXJmbG93LmNvbS9xLzIyNzU2MS8xMDE=