1
The code is even simple to calculate a seller’s yield by multiplying in the case of 150000 * 0.1 it returns 0
code /
public class FuncionarioComissionado {
//Strings private para poder usar Get/Set
//Atributos
private String nome;
private String CPF;
private double taxaComissao;
private double vendasBrutas;
private double rendimentos;
// Criação de um construtor para a classe FuncionarioComissionado
// Construtor
public FuncionarioComissionado(String nome, String CPF, double taxaComissao, double vendasBrutas) {
this.nome = nome;
this.CPF = CPF;
this.taxaComissao = taxaComissao;
this.vendasBrutas = vendasBrutas;
}
// Calculo dos Rendimentos
//Metodo
private void Rendimentos(){
rendimentos = (vendasBrutas * (taxaComissao / 100));
}
// Criação de Get's para cada Atributo
// Metodos
public double getRendimentos() {
return rendimentos;
}
public String getNome() {
return nome;
}
public String getCPF() {
return CPF;
}
public double getTaxaComissao() {
return taxaComissao / 100;
}
public double getVendasBrutas() {
return vendasBrutas;
}
}
test /
FuncionarioComissionado f1 = new FuncionarioComissionado("Guilherme", "12345678921",10,125000);
System.out.println(f1.getNome());
System.out.println(f1.getCPF());
System.out.println(f1.getTaxaComissao());
System.out.println(f1.getVendasBrutas());
System.out.println(f1.getRendimentos());
At what point the error occurs?
– user28595
trying to figure out but the error would be getRequests returning 0 instead of (125000 * 0.1)
– guilherme cabrals
You are not calculating yields, you are only returning an empty value of the variable.
– user28595
This account never comes to pass, because you just don’t do it.
– user28595
Wouldn’t that make the account? private void Yields(){ Yields = (saleBrutas * (taxCompled / 100));
– guilherme cabrals
Reread my last 2 comments again.
– user28595
ah ! Facepalm, I did not invoke the T_T method
– guilherme cabrals
Good in class son worked but in this same calling method returned 0
– guilherme cabrals