• Model an employee. It must have the employee's name ( String
), the department where he works ( String
), his salary ( double
), the date of entry into the bank ( String
) and his RG ( String
) .
• Create a recebeAumento(double percentual)
method that increases the employee's salary according to the parameter passed as argument. Also create a calculaGanhoAnual
method, which does not receive any parameters, returning the annual salary value considering 13th and vacation.
My draft (I'm trying to call the function calculates for the yearly gain, but I can not even do that).
package funcionario;
public class Funcionario {
String nome, dep, banco, RG;
double sal, novosal;
void recebe(double aumento){
double recebeAumento = this.sal + aumento;
this.sal = recebeAumento;
}
public static double calcula(){
sal * 12;
}
public static void main(String[] args) {
Funcionario f1;
f1 = new Funcionario();
f1.nome = "João";
f1.dep = "Defesa";
f1.banco = "Banco do Brasil S.A";
f1.RG = "798956-5";
f1.sal = 27000.0;
f1.recebe(2000);
System.out.println("Nome: " + f1.nome + "\nDepartamento: " + f1.dep + "\nBanco: " + f1.banco + "\nRG: " + f1.RG + "\nSalário: " + f1.sal);
}
}