Código Java:
Ver original
package javaapplication12; import java.io.BufferedReader; import java.io.InputStreamReader; public class JavaApplication12 { static int n=0; do{ menu(); } public static void menu(){ do{ + "1- INSERTAR \n " + "2- CONSULTAR " + "\n 3- ELIMINAR \n " + "4- FINALIZAR"); try{ N = br.readLine(); e.printStackTrace(); } }while(!esEntero(N) || conversor(N)<=0 || conversor(N)>=5 ); case 1: insertar(); break; case 2: consultar(); break; case 3: eliminar(); break; case 4: imprimir(); break; } } public static void insertar(){ if(n<50){ try{ no_[n] = br.readLine(); e.printStackTrace(); } try{ ap_[n] = br.readLine(); e.printStackTrace(); } try{ ma_[n] = br.readLine(); e.printStackTrace(); } try{ ca_[n] = br.readLine(); e.printStackTrace(); } n++; }else{ } } public static void eliminar(){ int encontrados=0; if(n>0){ try{ nombre = br.readLine(); e.printStackTrace(); } for(int i=0; i<n; i++){ if(no_[i].equals(nombre)){ encontrados++; for(int j=i; j<n; j++){ no_[j]=no_[j+1]; ap_[j]=ap_[j+1]; ma_[j]=ma_[j+1]; ca_[j]=ca_[j+1]; } i--; n--; } } if(encontrados>0){ }else{ } }else{ } } public static void consultar(){ if(n>0){ int eureka=0; try{ nombre = br.readLine(); e.printStackTrace(); } for(int i=0; i<n; i++){ if(no_[i].equals(nombre)){ eureka=1; } } if(eureka==1){ }else{ } } else{ } } for(int i = 0; i<cad.length(); i++) return false; return true; } int valor=0; try{ } return valor; } public static void imprimir(){ if(n>0){ for(int i=0; i<n; i++){ } } } }