-1
• Model an employee. He must have the employee’s name (String
), the department where he works (String
), your salary (double
), the date of entry into the bank (String
) and your ID (String
).
• Create a method recebeAumento(double percentual)
which increases the employee’s salary according to the parameter passed as argument. Also create a method calculaGanhoAnual
, which does not receive any parameter, returning the value of the annual salary considering 13th and holidays.
My draft (I’m trying to call the function calculates for annual gain, but I can’t even get 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);
}
}