Skip to content

Instantly share code, notes, and snippets.

@mauricioaniche
Created November 12, 2010 13:51
Show Gist options
  • Save mauricioaniche/674103 to your computer and use it in GitHub Desktop.
Save mauricioaniche/674103 to your computer and use it in GitHub Desktop.
Calculadora de Salario - Exemplo 2
public class CalculoDeSalario {
public CalculoDeSalario(RegrasFiscais regrasFiscais, ...) {
// ...
}
public double calcula(Funcionario f) {
if(f.getCargo() == Cargo.VENDEDOR) {
// calcula salario do vendedor usando regras fiscais, etc
}
if(f.getCargo() == Cargo.GERENTE) {
// calcula salario do gerente usando regras fiscais, etc
}
if(f.getCargo() == Cargo.MARKETING) {
// calcula salario do marketing usando regras fiscais, etc
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment