Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package matheusediogo;
- import java.util.Scanner;
- public class Aluno extends Pessoa{
- private String matricula;
- private int curso;
- private boolean reingresso;
- private int cont = 0;
- private String cpf;
- private int verifica;
- @Override
- public void resetarContador(int aluno){
- super.resetarContador(aluno);
- }
- public void cadastrarAluno(int aluno, String c){
- verifica = aluno;
- int x;
- super.cadastrarPessoa(c, aluno);
- if(verifica == aluno){
- cpf = super.getCpf();
- Scanner ler = new Scanner(System.in);
- System.out.print("Digite a Matricula: ");
- this.matricula = ler.nextLine();
- if(this.matricula.length() != 11){
- resetarContador(aluno);
- }
- else{
- System.out.print("Digite o Codigo do curso. 1.Sistemas de informação 2.Agrimessura 3.Agronomia: ");
- this.curso = ler.nextInt();
- System.out.print("Digite 1 se for reingressante: ");
- x = ler.nextInt();
- if(x == 1){
- this.reingresso = true;
- }
- else{
- this.reingresso = false;
- }
- }
- }
- }
- public void imprimir(){
- super.imprimir();
- System.out.println("Matricula: "+this.matricula);
- if(this.curso == 1){
- System.out.println("Curso: Bacharelado em Sistemas de Informação");
- }
- else if(this.curso == 2){
- System.out.println("Curso: Engenharia de Agrimessura e Cartográfica");
- }
- else if(this.curso == 3){
- System.out.println("Curso: Agronomia");
- }
- if(this.reingresso == true){
- System.out.println("O aluno é reingressante");
- }
- else{
- System.out.println("Primeira vez no curso");
- }
- }
- public String getMatricula(){
- return this.matricula;
- }
- public int getCurso(){
- return this.curso;
- }
- public boolean getReingresso(){
- return this.reingresso;
- }
- @Override
- public String getCpf(){
- return this.cpf;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement