diff --git a/Guia2/POO b/Guia2/POO new file mode 160000 index 0000000..b7f85f6 --- /dev/null +++ b/Guia2/POO @@ -0,0 +1 @@ +Subproject commit b7f85f6f8d76577804b45fd9a277779685acabfc diff --git a/Guia2/float b/Guia2/float new file mode 100644 index 0000000..e69de29 diff --git a/Guia2/src/__pycache__/__init__.cpython-311.pyc b/Guia2/src/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..350e015 Binary files /dev/null and b/Guia2/src/__pycache__/__init__.cpython-311.pyc differ diff --git a/Guia2/src/folha_pagamento/__pycache__/__init__.cpython-311.pyc b/Guia2/src/folha_pagamento/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..ad14bf4 Binary files /dev/null and b/Guia2/src/folha_pagamento/__pycache__/__init__.cpython-311.pyc differ diff --git a/Guia2/src/folha_pagamento/__pycache__/desenvolvedor.cpython-311.pyc b/Guia2/src/folha_pagamento/__pycache__/desenvolvedor.cpython-311.pyc new file mode 100644 index 0000000..c58eaea Binary files /dev/null and b/Guia2/src/folha_pagamento/__pycache__/desenvolvedor.cpython-311.pyc differ diff --git a/Guia2/src/folha_pagamento/__pycache__/estagiario.cpython-311.pyc b/Guia2/src/folha_pagamento/__pycache__/estagiario.cpython-311.pyc new file mode 100644 index 0000000..de5c10c Binary files /dev/null and b/Guia2/src/folha_pagamento/__pycache__/estagiario.cpython-311.pyc differ diff --git a/Guia2/src/folha_pagamento/__pycache__/funcionario.cpython-311.pyc b/Guia2/src/folha_pagamento/__pycache__/funcionario.cpython-311.pyc new file mode 100644 index 0000000..b24b96d Binary files /dev/null and b/Guia2/src/folha_pagamento/__pycache__/funcionario.cpython-311.pyc differ diff --git a/Guia2/src/folha_pagamento/__pycache__/gerente.cpython-311.pyc b/Guia2/src/folha_pagamento/__pycache__/gerente.cpython-311.pyc new file mode 100644 index 0000000..c9508ae Binary files /dev/null and b/Guia2/src/folha_pagamento/__pycache__/gerente.cpython-311.pyc differ diff --git a/Guia2/src/folha_pagamento/desenvolvedor.py b/Guia2/src/folha_pagamento/desenvolvedor.py index 5c5d3c9..ca243e0 100644 --- a/Guia2/src/folha_pagamento/desenvolvedor.py +++ b/Guia2/src/folha_pagamento/desenvolvedor.py @@ -1,6 +1,29 @@ from folha_pagamento.funcionario import Funcionario -# Desenvolva a classe Desenvolvedor aqui. +class Desenvolvedor(Funcionario): + def __init__(self, nome: str, matricula: str, salario_base: float, linguagem: str, senioridade: str): + super().__init__(nome, matricula, salario_base) + self.linguagem = linguagem + self.senioridade = senioridade -class Desenvolvedor: - pass \ No newline at end of file + def calcular_bonus(self) -> float: + 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.0 + + def calcular_descontos(self) -> float: + return self.salario_base * 0.08 + + def calcular_adicionais(self) -> float: + if self.linguagem == "Python": + return 500.0 + elif self.linguagem == "Java": + return 400.0 + elif self.linguagem == "JavaScript": + return 350.0 + else: + return 200.0 \ No newline at end of file diff --git a/Guia2/src/folha_pagamento/estagiario.py b/Guia2/src/folha_pagamento/estagiario.py index d50a433..c51fd4d 100644 --- a/Guia2/src/folha_pagamento/estagiario.py +++ b/Guia2/src/folha_pagamento/estagiario.py @@ -3,4 +3,24 @@ # Desenvolva a classe Estagiario aqui. class Estagiario: - pass \ No newline at end of file + from folha_pagamento.funcionario import Funcionario + +class Estagiario(Funcionario): + def __init__(self, nome: str, matricula: str, salario_base: float, curso: str, carga_horaria: int): + super().__init__(nome, matricula, salario_base) + self.curso = curso + self.carga_horaria = carga_horaria + + def calcular_bonus(self) -> float: + return self.salario_base * 0.03 + + def calcular_descontos(self) -> float: + return self.salario_base * 0.02 + + def calcular_adicionais(self) -> float: + if self.carga_horaria <= 20: + return 150.0 + elif self.carga_horaria <= 30: + return 250.0 + else: + return 350.0 \ No newline at end of file diff --git a/Guia2/src/folha_pagamento/gerente.py b/Guia2/src/folha_pagamento/gerente.py index 31819a1..baa5ed2 100644 --- a/Guia2/src/folha_pagamento/gerente.py +++ b/Guia2/src/folha_pagamento/gerente.py @@ -2,5 +2,28 @@ # Desenvolva a classe Gerente aqui. -class Gerente: - pass \ No newline at end of file +class Gerente(Funcionario): + def __init__(self, nome: str, matricula: str, salario_base: float, setor: str, qtd_equipe: int): + super().__init__(nome, matricula, salario_base) #passei isso aqui pra classe mae + self.setor = setor + self.qtd_equipe = qtd_equipe + #primeira funcao para calcular o salario + def calcular_bonus(self) -> float: + #salario mais o bous do negocio por equipe + 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) -> float: + #descoto de 12% + return self.salario_base * 0.12 + def calcular_adicionais(self) -> float: + #quanto mais resposabilidade maior o adicional + if self.qtd_equipe > 10: + return 2000.0 + elif self.qtd_equipe > 5: + return 1000.0 + else: + return 500.0 \ No newline at end of file diff --git a/Guia2/tests/__pycache__/__init__.cpython-311.pyc b/Guia2/tests/__pycache__/__init__.cpython-311.pyc new file mode 100644 index 0000000..bf2f63f Binary files /dev/null and b/Guia2/tests/__pycache__/__init__.cpython-311.pyc differ diff --git a/Guia2/tests/__pycache__/test_desenvolvedor.cpython-311-pytest-9.0.3.pyc b/Guia2/tests/__pycache__/test_desenvolvedor.cpython-311-pytest-9.0.3.pyc new file mode 100644 index 0000000..28fe1f1 Binary files /dev/null and b/Guia2/tests/__pycache__/test_desenvolvedor.cpython-311-pytest-9.0.3.pyc differ diff --git a/Guia2/tests/__pycache__/test_estagiario.cpython-311-pytest-9.0.3.pyc b/Guia2/tests/__pycache__/test_estagiario.cpython-311-pytest-9.0.3.pyc new file mode 100644 index 0000000..caa10fa Binary files /dev/null and b/Guia2/tests/__pycache__/test_estagiario.cpython-311-pytest-9.0.3.pyc differ diff --git a/Guia2/tests/__pycache__/test_gerente.cpython-311-pytest-9.0.3.pyc b/Guia2/tests/__pycache__/test_gerente.cpython-311-pytest-9.0.3.pyc new file mode 100644 index 0000000..fda676a Binary files /dev/null and b/Guia2/tests/__pycache__/test_gerente.cpython-311-pytest-9.0.3.pyc differ