Skip to content

Entrega final atividade #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

124 changes: 124 additions & 0 deletions .idea/uiDesigner.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions TB-Java-Projeto-Guiado-II.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
95 changes: 0 additions & 95 deletions src/funcionariosStarlabs/ArvoreFuncionarios.java

This file was deleted.

13 changes: 0 additions & 13 deletions src/funcionariosStarlabs/FuncionarioBaseNode.java

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
package funcionariosStarlabs;
package rhIbalo.controller;

public class CTO extends FuncionarioBase {

public CTO(String nome, String cargo, double salario, String cpf) {

import rhIbalo.model.FuncBase;

public class Cto extends FuncBase {

public Cto(String nome, String cargo, double salario, String cpf) {
super(nome, cargo, salario, cpf);
}

Expand Down
46 changes: 46 additions & 0 deletions src/rhIbalo/controller/GeradorFuncionario.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package rhIbalo.controller;
import rhIbalo.model.FuncBase;

import java.text.DecimalFormat;
import java.util.Random;

public class GeradorFuncionario extends FuncBase {

public GeradorFuncionario(String nome, String cargo, double salario, String cpf) {
super(nome, cargo, salario, cpf);
}

// Método para gerar valores aleatórios
public static GeradorFuncionario gerarFuncionarioAleatorio() {
Random gerador = new Random();

// Exemplo: Gerar nome aleatório
String[] nomes = {"Helena", "Miguel", "Arthur", "Gael", "Heitor", "Alice", "Theo", "Lara", "Davi", "Sophia", "Enzo", "Valentina", "Bernardo", "Isabella", "Rafael", "Laura", "Gabriel", "Manuela", "Pedro", "Júlia"};
String nomeAleatorio = nomes[gerador.nextInt(nomes.length)];

// Exemplo: Gerar cargo aleatório
String[] cargos = {"Analista", "Gerente", "Desenvolvedor", "Coordenador"};
String cargoAleatorio = cargos[gerador.nextInt(cargos.length)];

// Exemplo: Gerar salário aleatório entre 2000 e 8000
double salarioAleatorio = 2000 + gerador.nextDouble() * 6000;

// Exemplo: Gerar CPF aleatório (apenas para ilustração)
String cpfAleatorio = String.format("%03d.%03d.%03d-%02d",
gerador.nextInt(1000), gerador.nextInt(1000),
gerador.nextInt(1000), gerador.nextInt(100));

return new GeradorFuncionario(nomeAleatorio, cargoAleatorio, salarioAleatorio, cpfAleatorio);
}

// Método para exibir informações do funcionário
public void exibirInformacoes() {
DecimalFormat formatoSalario = new DecimalFormat("#,##0.00");
System.out.println("Nome: " + nome);
System.out.println("Cargo: " + cargo);
System.out.println("Salário: R$" + formatoSalario.format(salario));
System.out.println("CPF: " + cpf);
}


}
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package funcionariosStarlabs;
package rhIbalo.controller;
import rhIbalo.model.FuncBase;

public class VPDeEngenharia extends FuncionarioBase {
public VPDeEngenharia(String nome, String Cargo, double salario, String cpf) {
public class VPDeEng extends FuncBase {

public VPDeEng(String nome, String Cargo, double salario, String cpf) {
super(nome, Cargo, salario, cpf);
}

Expand All @@ -23,4 +24,4 @@ public void atualizarDados(double novoSalario, String novoCargo) {
public void remover() {
System.out.println("VP removido com sucesso");
}
}
}
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package funcionariosStarlabs;
package rhIbalo.model;

public abstract class FuncionarioBase implements FuncionarioBaseInterface {

public abstract class FuncBase implements FuncionarioInterface {
protected String nome;
protected String cargo;
protected double salario;
protected String cpf;

public FuncionarioBase(String nome, String cargo, double salario, String cpf) {
public FuncBase(String nome, String cargo, double salario, String cpf) {
this.nome = nome;
this.cargo = cargo;
this.salario = salario;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package funcionariosStarlabs;
package rhIbalo.model;

public interface FuncionarioInterface {

public interface FuncionarioBaseInterface {
String getNome();
void setNome(String nome);
String getCargo();
Expand All @@ -9,4 +10,4 @@ public interface FuncionarioBaseInterface {
void setSalario(double salario);
String getCpf();
void setCpf(String cpf);
}
}
Loading