Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- case 5: // Activar/desactivar registro de operaciones
- // CODIFICAR
- if (registro!=null){
- System.out.println("Activar registro de operaciones. \n Y/N: ");
- String opyn = teclado.nextLine();
- opyn=opyn.toUpperCase();
- if (opyn=="Y"){
- System.out.println("1. Registro en pantalla.");
- System.out.println("2. Registro en fichero.");
- System.out.println("Opcion: ");
- int op= teclado.nextInt();
- if (op==1){
- try {
- registro=new RegistroEnPantalla();
- } catch (RegistroException e) {
- System.out.println(e.getMessage());
- }
- }
- if (op==2){
- try {
- registro=new RegistroEnFichero("registro.txt");
- } catch (RegistroException e) {
- System.out.println(e.getMessage());
- }
- }
- else
- System.out.println("Opcion no valida.");
- else break; //opyn=N
- }
- else{
- System.out.println("Activar registro de operaciones. \n Y/N: ");
- String opyn = teclado.nextLine();
- opyn=opyn.toUpperCase();
- if (opyn=="Y")
- registro=null;
- else break; //opyn=N
- }
- break;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement