Advertisement
argentinapb

Pessoa

Oct 12th, 2019
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. package matheusediogo;
  2.  
  3. import java.util.Scanner;
  4.  
  5. public class Pessoa {
  6. private String cpf;
  7. private String nome;
  8. private String endereço;
  9. private int ano;
  10.  
  11. protected void resetarContador(int docente){
  12. docente--;
  13. }
  14. protected void cadastrarPessoa(String c, int docente){
  15. Scanner ler = new Scanner(System.in);
  16. this.cpf = c;
  17. System.out.printf("Digite o Nome: ");
  18. this.nome = ler.nextLine();
  19. System.out.println("Digite o endereço da seguinte forma: Bairro ___ Rua___ Numero ____ Cidade_____");
  20. this.endereço = ler.nextLine();
  21. System.out.printf("Digite o Ano de Nascimento: ");
  22. this.ano = ler.nextInt();
  23. if(this.ano < 1920){
  24. resetarContador(docente);
  25. }
  26. }
  27. protected void imprimir(){
  28. System.out.println("Nome: "+this.nome);
  29. System.out.println("Cpf: " +this.cpf);
  30. System.out.println("Ano de Nascimento: "+this.ano);
  31. System.out.println("Endereço: " +this.endereço);
  32. }
  33. public String getCpf(){
  34. return this.cpf;
  35. }
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement