Advertisement
CarlosWGama

poo4-menu

May 25th, 2018
328
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.68 KB | None | 0 0
  1. public class Menu {
  2.  
  3.     private static Scanner reader = new Scanner(System.in);
  4.    
  5.     public static void editarPerfil(Aluno aluno, Professor professor) {
  6.        
  7.         System.out.println("Digite seu nome: ");
  8.         String nome = reader.next();
  9.         System.out.println("Digite sua matricula: ");
  10.         int matricula = reader.nextInt();
  11.         System.out.println("Digite sua nova senha:");
  12.         String senha = reader.next();
  13.        
  14.         if (aluno != null) {
  15.             aluno.setNome(nome);
  16.             aluno.setMatricula(matricula);
  17.             aluno.setSenha(senha);
  18.             aluno.exibirDados();
  19.         } else {
  20.             professor.setNome(nome);
  21.             professor.setMatricula(matricula);
  22.             professor.setSenha(senha);
  23.             professor.exibirDados();
  24.         }
  25.     }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement