Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.02 KB | None | 0 0
  1. case 5: // Activar/desactivar registro de operaciones
  2. // CODIFICAR
  3. if (registro!=null){
  4. System.out.println("Activar registro de operaciones. \n Y/N: ");
  5. String opyn = teclado.nextLine();
  6. opyn=opyn.toUpperCase();
  7. if (opyn=="Y"){
  8. System.out.println("1. Registro en pantalla.");
  9. System.out.println("2. Registro en fichero.");
  10. System.out.println("Opcion: ");
  11. int op= teclado.nextInt();
  12. if (op==1){
  13. try {
  14. registro=new RegistroEnPantalla();
  15. } catch (RegistroException e) {
  16. System.out.println(e.getMessage());
  17. }
  18. }
  19. if (op==2){
  20. try {
  21. registro=new RegistroEnFichero("registro.txt");
  22. } catch (RegistroException e) {
  23. System.out.println(e.getMessage());
  24. }
  25. }
  26. else
  27. System.out.println("Opcion no valida.");
  28. else break; //opyn=N
  29. }
  30. else{
  31. System.out.println("Activar registro de operaciones. \n Y/N: ");
  32. String opyn = teclado.nextLine();
  33. opyn=opyn.toUpperCase();
  34. if (opyn=="Y")
  35. registro=null;
  36. else break; //opyn=N
  37. }
  38. break;
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement