Advertisement
argentinapb

aluno

Oct 12th, 2019
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.24 KB | None | 0 0
  1. package matheusediogo;
  2.  
  3. import java.util.Scanner;
  4.  
  5.  
  6. public class Aluno extends Pessoa{
  7. private String matricula;
  8. private int curso;
  9. private boolean reingresso;
  10. private int cont = 0;
  11. private String cpf;
  12. private int verifica;
  13.  
  14. @Override
  15. public void resetarContador(int aluno){
  16. super.resetarContador(aluno);
  17.  
  18. }
  19. public void cadastrarAluno(int aluno, String c){
  20. verifica = aluno;
  21. int x;
  22. super.cadastrarPessoa(c, aluno);
  23. if(verifica == aluno){
  24. cpf = super.getCpf();
  25. Scanner ler = new Scanner(System.in);
  26. System.out.print("Digite a Matricula: ");
  27. this.matricula = ler.nextLine();
  28. if(this.matricula.length() != 11){
  29. resetarContador(aluno);
  30. }
  31. else{
  32. System.out.print("Digite o Codigo do curso. 1.Sistemas de informação 2.Agrimessura 3.Agronomia: ");
  33. this.curso = ler.nextInt();
  34. System.out.print("Digite 1 se for reingressante: ");
  35. x = ler.nextInt();
  36. if(x == 1){
  37. this.reingresso = true;
  38. }
  39. else{
  40. this.reingresso = false;
  41. }
  42. }
  43. }
  44. }
  45. public void imprimir(){
  46. super.imprimir();
  47. System.out.println("Matricula: "+this.matricula);
  48. if(this.curso == 1){
  49. System.out.println("Curso: Bacharelado em Sistemas de Informação");
  50. }
  51. else if(this.curso == 2){
  52. System.out.println("Curso: Engenharia de Agrimessura e Cartográfica");
  53. }
  54. else if(this.curso == 3){
  55. System.out.println("Curso: Agronomia");
  56. }
  57. if(this.reingresso == true){
  58. System.out.println("O aluno é reingressante");
  59. }
  60. else{
  61. System.out.println("Primeira vez no curso");
  62. }
  63. }
  64. public String getMatricula(){
  65. return this.matricula;
  66. }
  67. public int getCurso(){
  68. return this.curso;
  69. }
  70. public boolean getReingresso(){
  71. return this.reingresso;
  72. }
  73. @Override
  74. public String getCpf(){
  75. return this.cpf;
  76. }
  77. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement