argentinapb

Pessoa

Oct 12th, 2019
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.25 KB | None | 0 0
  1. package matheusediogo;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Docente extends Pessoa{
  6. private String siape;
  7. private String titulo;
  8. private int carga;
  9. private int tipo;
  10. private String cpf;
  11. private int verifica;
  12.  
  13. @Override
  14. public void resetarContador(int docente){
  15. super.resetarContador(docente);
  16.  
  17. }
  18. public void cadastrarDocente(int docente, String c){
  19. verifica = docente;
  20. super.cadastrarPessoa(c, docente);
  21. if(verifica == docente){
  22. cpf = super.getCpf();
  23. Scanner ler = new Scanner(System.in);
  24.  
  25. System.out.printf("Titulação: ");
  26. this.titulo = ler.nextLine();
  27.  
  28. System.out.printf("Carga Horária: ");
  29. this.carga = ler.nextInt();
  30.  
  31. System.out.printf("Tipo de Docente: ");
  32. this.tipo = ler.nextInt();
  33. ler.nextLine();
  34.  
  35. System.out.printf("SIAPE: ");
  36. this.siape = ler.nextLine();
  37.  
  38. if(this.siape.length() != 7) {
  39. resetarContador(docente);
  40.  
  41. }
  42. else if(this.carga < 0 || this.carga > 40){
  43. resetarContador(docente);
  44.  
  45. }
  46. }
  47. }
  48. public void imprimir(){
  49.  
  50. super.imprimir();
  51. System.out.println("SIAPE: " +this.siape);
  52.  
  53. if(this.tipo == 1){
  54. System.out.println("Docente Efetivo");
  55. }
  56. else if(this.tipo == 2){
  57. System.out.println("Docente Temporário");
  58. }
  59.  
  60. System.out.println("Carga Horária: "+this.carga);
  61.  
  62. if("me".equals(this.titulo)){
  63. System.out.println("Titulação: Mestre");
  64. }
  65. else if("gr".equals(this.titulo)){
  66. System.out.println("Titulação: Graduado");
  67. }
  68. else if("do".equals(this.titulo)){
  69. System.out.println("Titulação: Doutorado");
  70. }
  71.  
  72. }
  73. public String getSiape(){
  74. return this.siape;
  75. }
  76. public int getTipo(){
  77. return this.tipo;
  78. }
  79. public String getTitulo(){
  80. return this.titulo;
  81. }
  82. @Override
  83. public String getCpf(){
  84. return this.cpf;
  85. }
  86. }
Add Comment
Please, Sign In to add comment