first commit
This commit is contained in:
24
AtividadeBiblioteca/src/org/me/empresainfo/Funcionario.java
Normal file
24
AtividadeBiblioteca/src/org/me/empresainfo/Funcionario.java
Normal file
@ -0,0 +1,24 @@
|
||||
package org.me.empresainfo;
|
||||
public class Funcionario {
|
||||
private long CPF;
|
||||
private String Nome;
|
||||
private double Salario;
|
||||
|
||||
public void setCPF(long _CPF)
|
||||
{
|
||||
this.CPF = _CPF;
|
||||
}
|
||||
public void setNome(String _Nome)
|
||||
{
|
||||
this.Nome = _Nome;
|
||||
}
|
||||
public void setSalario(double _Salario)
|
||||
{
|
||||
this.Salario = _Salario;
|
||||
}
|
||||
|
||||
// Getters
|
||||
public long getCPF(){return this.CPF;}
|
||||
public String getNome(){return this.Nome;}
|
||||
public double getSalario(){return this.Salario;}
|
||||
}
|
16
AtividadeBiblioteca/src/org/me/empresainfo/Secretaria.java
Normal file
16
AtividadeBiblioteca/src/org/me/empresainfo/Secretaria.java
Normal file
@ -0,0 +1,16 @@
|
||||
package org.me.empresainfo;
|
||||
public class Secretaria extends Funcionario{
|
||||
private String Departamento, Idioma;
|
||||
|
||||
public void setDepartamento(String _Departamento)
|
||||
{
|
||||
this.Departamento = _Departamento;
|
||||
}
|
||||
public void setIdioma(String _Idioma)
|
||||
{
|
||||
this.Idioma = _Idioma;
|
||||
}
|
||||
|
||||
public String getDepartamento(){return this.Departamento;}
|
||||
public String getIdioma(){return this.Idioma;}
|
||||
}
|
17
AtividadeBiblioteca/src/org/me/empresainfo/Vendedor.java
Normal file
17
AtividadeBiblioteca/src/org/me/empresainfo/Vendedor.java
Normal file
@ -0,0 +1,17 @@
|
||||
package org.me.empresainfo;
|
||||
public class Vendedor extends Funcionario{
|
||||
private String Regiao;
|
||||
private double Comissao;
|
||||
|
||||
public void setRegiao(String _Regiao)
|
||||
{
|
||||
this.Regiao = _Regiao;
|
||||
}
|
||||
public void setComissao(double _Comissao)
|
||||
{
|
||||
this.Comissao = _Comissao;
|
||||
}
|
||||
|
||||
public String getRegiao(){return this.Regiao;}
|
||||
public double getComissao(){return this.Comissao;}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package org.me.testeempresainfo;
|
||||
import java.util.Scanner;
|
||||
import org.me.empresainfo.Secretaria;
|
||||
import org.me.empresainfo.Vendedor;
|
||||
|
||||
public class TesteEmpresaInfo {
|
||||
|
||||
public static void main(String[] args) {
|
||||
Secretaria s1 = new Secretaria();
|
||||
Vendedor v1 = new Vendedor();
|
||||
|
||||
Scanner scan = new Scanner(System.in);
|
||||
|
||||
System.out.println("Digite o nome para Secretaria");
|
||||
s1.setNome(scan.nextLine());
|
||||
|
||||
System.out.printf("\nDigite o CPF de %s\n",s1.getNome());
|
||||
s1.setCPF(scan.nextLong());
|
||||
|
||||
scan.nextLine(); // Pular linha
|
||||
System.out.printf("\nDigite o Dept. de %s\n",s1.getNome());
|
||||
s1.setDepartamento(scan.nextLine());
|
||||
|
||||
System.out.printf("\nDigite o Idioma de %s\n",s1.getNome());
|
||||
s1.setIdioma(scan.nextLine());
|
||||
|
||||
System.out.printf("\nDigite o Salario. de %s\n",s1.getNome());
|
||||
s1.setSalario(scan.nextDouble());
|
||||
|
||||
// ------- VENDEDOR -------- //
|
||||
scan.nextLine(); // Pular linha
|
||||
System.out.println("\nDigite o nome para Vendedor");
|
||||
v1.setNome(scan.nextLine());
|
||||
|
||||
System.out.printf("\nDigite o CPF de %s\n",v1.getNome());
|
||||
v1.setCPF(scan.nextLong());
|
||||
|
||||
scan.nextLine(); // Pular linha
|
||||
System.out.printf("\nDigite a Região de %s\n",v1.getNome());
|
||||
v1.setRegiao(scan.nextLine());
|
||||
|
||||
System.out.printf("\nDigite a comissao de %s\n",v1.getNome());
|
||||
v1.setComissao(scan.nextDouble());
|
||||
|
||||
System.out.printf("\nDigite o Salario. de %s\n",v1.getNome());
|
||||
v1.setSalario(scan.nextDouble());
|
||||
|
||||
// Imprimir valores //
|
||||
System.out.printf("\nSecretaria\n\t"
|
||||
+ "Nome:%s\n\t"
|
||||
+ "CPF: %d\n\t"
|
||||
+ "Salário: %.2f\n\t"
|
||||
+ "Departamento: %s\n\t"
|
||||
+ "Idioma: %s."
|
||||
,s1.getNome(),s1.getCPF(),
|
||||
s1.getSalario(),s1.getDepartamento(),
|
||||
s1.getIdioma());
|
||||
|
||||
System.out.printf("\nVendedor\n\t"
|
||||
+ "Nome:%s\n\t"
|
||||
+ "CPF: %d\n\t"
|
||||
+ "Salário: %.2f\n\t"
|
||||
+ "Comissão: %.2f\n\t"
|
||||
+ "Região: %s."
|
||||
,v1.getNome(),v1.getCPF(),
|
||||
v1.getSalario(),v1.getComissao(),
|
||||
v1.getRegiao());
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user