Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package matheusediogo;
- import java.util.Scanner;
- public class Pessoa {
- private String cpf;
- private String nome;
- private String endereço;
- private int ano;
- protected void resetarContador(int docente){
- docente--;
- }
- protected void cadastrarPessoa(String c, int docente){
- Scanner ler = new Scanner(System.in);
- this.cpf = c;
- System.out.printf("Digite o Nome: ");
- this.nome = ler.nextLine();
- System.out.println("Digite o endereço da seguinte forma: Bairro ___ Rua___ Numero ____ Cidade_____");
- this.endereço = ler.nextLine();
- System.out.printf("Digite o Ano de Nascimento: ");
- this.ano = ler.nextInt();
- if(this.ano < 1920){
- resetarContador(docente);
- }
- }
- protected void imprimir(){
- System.out.println("Nome: "+this.nome);
- System.out.println("Cpf: " +this.cpf);
- System.out.println("Ano de Nascimento: "+this.ano);
- System.out.println("Endereço: " +this.endereço);
- }
- public String getCpf(){
- return this.cpf;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement