/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
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()); f1.calculaRendimentos();
System.
out.
println(f1.
getRendimentos()); }
}
class FuncionarioComissionado {
//Strings private para poder usar Get/Set
//Atributos
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
public void calculaRendimentos(){
rendimentos = (vendasBrutas * (taxaComissao / 100));
}
// Criação de Get's para cada Atributo
// Metodos
public double getRendimentos() {
return rendimentos;
}
return nome;
}
return CPF;
}
public double getTaxaComissao() {
return taxaComissao / 100;
}
public double getVendasBrutas() {
return vendasBrutas;
}
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJRnVuY2lvbmFyaW9Db21pc3Npb25hZG8gZjEgPSBuZXcgRnVuY2lvbmFyaW9Db21pc3Npb25hZG8oIk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