diff --git a/Guia2/src/__pycache__/__init__.cpython-314.pyc b/Guia2/src/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000..6cba23f Binary files /dev/null and b/Guia2/src/__pycache__/__init__.cpython-314.pyc differ diff --git a/Guia2/src/folha_pagamento/__pycache__/__init__.cpython-314.pyc b/Guia2/src/folha_pagamento/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000..d47a21a Binary files /dev/null and b/Guia2/src/folha_pagamento/__pycache__/__init__.cpython-314.pyc differ diff --git a/Guia2/src/folha_pagamento/__pycache__/desenvolvedor.cpython-314.pyc b/Guia2/src/folha_pagamento/__pycache__/desenvolvedor.cpython-314.pyc new file mode 100644 index 0000000..65fadb8 Binary files /dev/null and b/Guia2/src/folha_pagamento/__pycache__/desenvolvedor.cpython-314.pyc differ diff --git a/Guia2/src/folha_pagamento/__pycache__/estagiario.cpython-314.pyc b/Guia2/src/folha_pagamento/__pycache__/estagiario.cpython-314.pyc new file mode 100644 index 0000000..408c337 Binary files /dev/null and b/Guia2/src/folha_pagamento/__pycache__/estagiario.cpython-314.pyc differ diff --git a/Guia2/src/folha_pagamento/__pycache__/funcionario.cpython-314.pyc b/Guia2/src/folha_pagamento/__pycache__/funcionario.cpython-314.pyc new file mode 100644 index 0000000..699f9be Binary files /dev/null and b/Guia2/src/folha_pagamento/__pycache__/funcionario.cpython-314.pyc differ diff --git a/Guia2/src/folha_pagamento/__pycache__/gerente.cpython-314.pyc b/Guia2/src/folha_pagamento/__pycache__/gerente.cpython-314.pyc new file mode 100644 index 0000000..8a26092 Binary files /dev/null and b/Guia2/src/folha_pagamento/__pycache__/gerente.cpython-314.pyc differ diff --git a/Guia2/src/folha_pagamento/desenvolvedor.py b/Guia2/src/folha_pagamento/desenvolvedor.py index 5c5d3c9..d393791 100644 --- a/Guia2/src/folha_pagamento/desenvolvedor.py +++ b/Guia2/src/folha_pagamento/desenvolvedor.py @@ -1,6 +1,55 @@ from folha_pagamento.funcionario import Funcionario -# Desenvolva a classe Desenvolvedor aqui. +class Desenvolvedor(Funcionario): -class Desenvolvedor: - pass \ No newline at end of file + def __init__(self, nome, matricula, salario_base, linguagem, senioridade): + super().__init__(nome, matricula, salario_base) + self._linguagem = linguagem + self._senioridade = senioridade + + @property + def linguagem(self): + return self._linguagem + + @linguagem.setter + def linguagem(self, valor): + self._linguagem = valor + + @property + def senioridade(self): + return self._senioridade + + @senioridade.setter + def senioridade(self, valor): + self._senioridade = valor + + def calcular_bonus(self): + + if self.senioridade == 'junior': + return self.salario_base * 0.05 + + elif self.senioridade == 'pleno': + return self.salario_base * 0.10 + + elif self.senioridade == 'senior': + return self.salario_base * 0.15 + + return 0 + + def calcular_descontos(self): + return self.salario_base * 0.08 + + def calcular_adicionais(self): + + if self.linguagem == 'Python': + return 500 + + elif self.linguagem == 'Java': + return 400 + + elif self.linguagem == 'JavaScript': + return 350 + + else: + return 200 + \ No newline at end of file diff --git a/Guia2/src/folha_pagamento/estagiario.py b/Guia2/src/folha_pagamento/estagiario.py index d50a433..d884f30 100644 --- a/Guia2/src/folha_pagamento/estagiario.py +++ b/Guia2/src/folha_pagamento/estagiario.py @@ -2,5 +2,44 @@ # Desenvolva a classe Estagiario aqui. -class Estagiario: - pass \ No newline at end of file +class Estagiario(Funcionario): + def __init__(self, nome, matricula, salario_base, curso, carga_horaria): + super().__init__(nome, matricula, salario_base) + if not curso: + raise ValueError("Curso invalido") + + if not carga_horaria: + raise ValueError("Carga horária inválida") + + @property + def curso(self): + return self._curso + + @curso.setter + def curso(self, valor): + self._curso = valor + + @property + def carga_horaria(self): + return self._carga_horaria + + @carga_horaria.setter + def carga_horaria(self, valor): + if valor <= 0: + raise ValueError("Quantidade de horas da carga horaria invalida") + self._carga_horaria = valor + + + def calcular_bonus(self): + return self.salario_base * 0.03 + + def calcular_descontos(self): + return self.salario_base * 0.02 + + def calcular_adicionais(self): + if self.carga_horaria <= 20: + return 150 + elif self.carga_horaria <= 30: + return 250 + return 350 + \ No newline at end of file diff --git a/Guia2/src/folha_pagamento/gerente.py b/Guia2/src/folha_pagamento/gerente.py index 31819a1..dc63182 100644 --- a/Guia2/src/folha_pagamento/gerente.py +++ b/Guia2/src/folha_pagamento/gerente.py @@ -2,5 +2,56 @@ # Desenvolva a classe Gerente aqui. -class Gerente: - pass \ No newline at end of file +class Gerente(Funcionario): + def __init__(self, nome, matricula, salario_base, setor, qtd_equipe): + super().__init__(nome, matricula, salario_base) + + # Verificação do setor + if not setor: + raise ValueError("Setor Invalido") + + # Verificação da quantidade da equipe + if not qtd_equipe: + raise ValueError("Quantidade de membros da equipe inválida") + + @property + def setor(self): + return self._setor + + @setor.setter + def setor(self, valor): + self._setor = valor + + @property + def qtd_equipe(self): + return self._qtd_equipe + + @qtd_equipe.setter + def qtd_equipe(self, valor): + if valor <= 0: + raise ValueError("Quantidade invalida de membros da equipe") + self._qtd_equipe = valor + + def calcular_bonus(self): + if self.qtd_equipe <= 5: + return self.salario_base * 0.10 + + elif self.qtd_equipe <= 10: + return self.salario_base * 0.15 + + else: + return self.salario_base * 0.20 + + def calcular_descontos(self): + return self._salario_base * 0.12 + + def calcular_adicionais(self): + if self.qtd_equipe > 10: + return 2000 + elif self.qtd_equipe > 5: + return 1000 + else: + return 500 + + + \ No newline at end of file diff --git a/Guia2/tests/__pycache__/__init__.cpython-314.pyc b/Guia2/tests/__pycache__/__init__.cpython-314.pyc new file mode 100644 index 0000000..f07d568 Binary files /dev/null and b/Guia2/tests/__pycache__/__init__.cpython-314.pyc differ diff --git a/Guia2/tests/__pycache__/test_desenvolvedor.cpython-314-pytest-9.0.3.pyc b/Guia2/tests/__pycache__/test_desenvolvedor.cpython-314-pytest-9.0.3.pyc new file mode 100644 index 0000000..13a7324 Binary files /dev/null and b/Guia2/tests/__pycache__/test_desenvolvedor.cpython-314-pytest-9.0.3.pyc differ diff --git a/Guia2/tests/__pycache__/test_estagiario.cpython-314-pytest-9.0.3.pyc b/Guia2/tests/__pycache__/test_estagiario.cpython-314-pytest-9.0.3.pyc new file mode 100644 index 0000000..83f08d6 Binary files /dev/null and b/Guia2/tests/__pycache__/test_estagiario.cpython-314-pytest-9.0.3.pyc differ diff --git a/Guia2/tests/__pycache__/test_gerente.cpython-314-pytest-9.0.3.pyc b/Guia2/tests/__pycache__/test_gerente.cpython-314-pytest-9.0.3.pyc new file mode 100644 index 0000000..e3bec33 Binary files /dev/null and b/Guia2/tests/__pycache__/test_gerente.cpython-314-pytest-9.0.3.pyc differ