Enviar búsqueda
Cargar
Error palabra.java
•
0 recomendaciones
•
169 vistas
A
Ayuda Universidad
Seguir
Error en Palabras java
Leer menos
Leer más
Tecnología
Entretenimiento y humor
Denunciar
Compartir
Denunciar
Compartir
1 de 8
Descargar ahora
Descargar para leer sin conexión
Recomendados
Ejercicio sql server vs visual .net
Ejercicio sql server vs visual .net
Ayuda Universidad
Android
Android
Ayuda Universidad
What's Next in Growth? 2016
What's Next in Growth? 2016
Andrew Chen
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post Formats
Barry Feldman
The Outcome Economy
The Outcome Economy
Helge Tennø
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
Barry Feldman
Getchars
Getchars
CamiEscobar1995
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ GETCHARS
CamiEscobar1995
Recomendados
Ejercicio sql server vs visual .net
Ejercicio sql server vs visual .net
Ayuda Universidad
Android
Android
Ayuda Universidad
What's Next in Growth? 2016
What's Next in Growth? 2016
Andrew Chen
The Six Highest Performing B2B Blog Post Formats
The Six Highest Performing B2B Blog Post Formats
Barry Feldman
The Outcome Economy
The Outcome Economy
Helge Tennø
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
32 Ways a Digital Marketing Consultant Can Help Grow Your Business
Barry Feldman
Getchars
Getchars
CamiEscobar1995
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR CAMILA ESCOBAR LOPEZ GETCHARS
CamiEscobar1995
UNIVERSIDAD CENTRAL DEL ECUADOR GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR GETCHARS
CamiEscobar1995
Getchars
Getchars
CamiEscobar1995
Deber de programación
Deber de programación
legnasilvana
Action scrip
Action scrip
Jesus Alverto Idrovo Martinez
Progrando en flash(action scrit).
Progrando en flash(action scrit).
Jesus Alverto Idrovo Martinez
Practicas c++
Practicas c++
Jhonathan Villalobos
Practicas c++
Practicas c++
Jhonathan Villalobos
Metodos de ordenamiento
Metodos de ordenamiento
Kary Luera Jaramillo
Practicas segundo parcial de programacion avanzada
Practicas segundo parcial de programacion avanzada
Dariio Lopezz Young
Dart como alternativa a TypeScript (Codemotion 2016)
Dart como alternativa a TypeScript (Codemotion 2016)
Rafael Bermúdez Míguez
Java Basico
Java Basico
RicardoOS
Action escript
Action escript
Andres Felipe Enriquez
Ejercicios resueltos practica 2 (nueva 2014) informática ii
Ejercicios resueltos practica 2 (nueva 2014) informática ii
Alvin Jacobs
funciones programacion
funciones programacion
Alexandra Diaz
Arreglos
Arreglos
Juanita Qontreras
Kruskal
Kruskal
Jorge
Hernandez_Hernandez_Practica web de la sesion 12.pptx
Hernandez_Hernandez_Practica web de la sesion 12.pptx
JOSEMANUELHERNANDEZH11
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
SergioMendoza354770
Redes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdf
soporteupcology
Proyecto integrador. Las TIC en la sociedad S4.pptx
Proyecto integrador. Las TIC en la sociedad S4.pptx
241521559
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Keyla Dolores Méndez
SalmorejoTech 2024 - Spring Boot <3 Testcontainers
SalmorejoTech 2024 - Spring Boot <3 Testcontainers
Iván López Martín
Más contenido relacionado
Similar a Error palabra.java
UNIVERSIDAD CENTRAL DEL ECUADOR GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR GETCHARS
CamiEscobar1995
Getchars
Getchars
CamiEscobar1995
Deber de programación
Deber de programación
legnasilvana
Action scrip
Action scrip
Jesus Alverto Idrovo Martinez
Progrando en flash(action scrit).
Progrando en flash(action scrit).
Jesus Alverto Idrovo Martinez
Practicas c++
Practicas c++
Jhonathan Villalobos
Practicas c++
Practicas c++
Jhonathan Villalobos
Metodos de ordenamiento
Metodos de ordenamiento
Kary Luera Jaramillo
Practicas segundo parcial de programacion avanzada
Practicas segundo parcial de programacion avanzada
Dariio Lopezz Young
Dart como alternativa a TypeScript (Codemotion 2016)
Dart como alternativa a TypeScript (Codemotion 2016)
Rafael Bermúdez Míguez
Java Basico
Java Basico
RicardoOS
Action escript
Action escript
Andres Felipe Enriquez
Ejercicios resueltos practica 2 (nueva 2014) informática ii
Ejercicios resueltos practica 2 (nueva 2014) informática ii
Alvin Jacobs
funciones programacion
funciones programacion
Alexandra Diaz
Arreglos
Arreglos
Juanita Qontreras
Kruskal
Kruskal
Jorge
Similar a Error palabra.java
(16)
UNIVERSIDAD CENTRAL DEL ECUADOR GETCHARS
UNIVERSIDAD CENTRAL DEL ECUADOR GETCHARS
Getchars
Getchars
Deber de programación
Deber de programación
Action scrip
Action scrip
Progrando en flash(action scrit).
Progrando en flash(action scrit).
Practicas c++
Practicas c++
Practicas c++
Practicas c++
Metodos de ordenamiento
Metodos de ordenamiento
Practicas segundo parcial de programacion avanzada
Practicas segundo parcial de programacion avanzada
Dart como alternativa a TypeScript (Codemotion 2016)
Dart como alternativa a TypeScript (Codemotion 2016)
Java Basico
Java Basico
Action escript
Action escript
Ejercicios resueltos practica 2 (nueva 2014) informática ii
Ejercicios resueltos practica 2 (nueva 2014) informática ii
funciones programacion
funciones programacion
Arreglos
Arreglos
Kruskal
Kruskal
Último
Hernandez_Hernandez_Practica web de la sesion 12.pptx
Hernandez_Hernandez_Practica web de la sesion 12.pptx
JOSEMANUELHERNANDEZH11
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
SergioMendoza354770
Redes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdf
soporteupcology
Proyecto integrador. Las TIC en la sociedad S4.pptx
Proyecto integrador. Las TIC en la sociedad S4.pptx
241521559
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Keyla Dolores Méndez
SalmorejoTech 2024 - Spring Boot <3 Testcontainers
SalmorejoTech 2024 - Spring Boot <3 Testcontainers
Iván López Martín
trabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdf
IsabellaMontaomurill
KELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento Protégeles
Fundación YOD YOD
EPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial Uninove
FagnerLisboa3
Plan de aula informatica segundo periodo.docx
Plan de aula informatica segundo periodo.docx
pabonheidy28
Instrumentación Hoy_ INTERPRETAR EL DIAGRAMA UNIFILAR GENERAL DE UNA PLANTA I...
Instrumentación Hoy_ INTERPRETAR EL DIAGRAMA UNIFILAR GENERAL DE UNA PLANTA I...
AlanCedillo9
guía de registro de slideshare por Brayan Joseph
guía de registro de slideshare por Brayan Joseph
BRAYANJOSEPHPEREZGOM
CLASE DE TECNOLOGIA E INFORMATICA PRIMARIA
CLASE DE TECNOLOGIA E INFORMATICA PRIMARIA
WilbisVega
Trabajo Mas Completo De Excel en clase tecnología
Trabajo Mas Completo De Excel en clase tecnología
ssuserf18419
La era de la educación digital y sus desafios
La era de la educación digital y sus desafios
Fundación YOD YOD
International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)
GDGSucre
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
silviayucra2
ATAJOS DE WINDOWS. Los diferentes atajos para utilizar en windows y ser más e...
ATAJOS DE WINDOWS. Los diferentes atajos para utilizar en windows y ser más e...
FacuMeza2
Cortes-24-de-abril-Tungurahua-3 año 2024
Cortes-24-de-abril-Tungurahua-3 año 2024
GiovanniJavierHidalg
Último
(19)
Hernandez_Hernandez_Practica web de la sesion 12.pptx
Hernandez_Hernandez_Practica web de la sesion 12.pptx
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
PARTES DE UN OSCILOSCOPIO ANALOGICO .pdf
Redes direccionamiento y subredes ipv4 2024 .pdf
Redes direccionamiento y subredes ipv4 2024 .pdf
Proyecto integrador. Las TIC en la sociedad S4.pptx
Proyecto integrador. Las TIC en la sociedad S4.pptx
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
Global Azure Lima 2024 - Integración de Datos con Microsoft Fabric
SalmorejoTech 2024 - Spring Boot <3 Testcontainers
SalmorejoTech 2024 - Spring Boot <3 Testcontainers
trabajotecologiaisabella-240424003133-8f126965.pdf
trabajotecologiaisabella-240424003133-8f126965.pdf
KELA Presentacion Costa Rica 2024 - evento Protégeles
KELA Presentacion Costa Rica 2024 - evento Protégeles
EPA-pdf resultado da prova presencial Uninove
EPA-pdf resultado da prova presencial Uninove
Plan de aula informatica segundo periodo.docx
Plan de aula informatica segundo periodo.docx
Instrumentación Hoy_ INTERPRETAR EL DIAGRAMA UNIFILAR GENERAL DE UNA PLANTA I...
Instrumentación Hoy_ INTERPRETAR EL DIAGRAMA UNIFILAR GENERAL DE UNA PLANTA I...
guía de registro de slideshare por Brayan Joseph
guía de registro de slideshare por Brayan Joseph
CLASE DE TECNOLOGIA E INFORMATICA PRIMARIA
CLASE DE TECNOLOGIA E INFORMATICA PRIMARIA
Trabajo Mas Completo De Excel en clase tecnología
Trabajo Mas Completo De Excel en clase tecnología
La era de la educación digital y sus desafios
La era de la educación digital y sus desafios
International Women's Day Sucre 2024 (IWD)
International Women's Day Sucre 2024 (IWD)
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
POWER POINT YUCRAElabore una PRESENTACIÓN CORTA sobre el video película: La C...
ATAJOS DE WINDOWS. Los diferentes atajos para utilizar en windows y ser más e...
ATAJOS DE WINDOWS. Los diferentes atajos para utilizar en windows y ser más e...
Cortes-24-de-abril-Tungurahua-3 año 2024
Cortes-24-de-abril-Tungurahua-3 año 2024
Error palabra.java
1.
import javax.swing.*; import java.awt.*; import
java.io.*; public class errores{ public static void main(String [] args){ //String mensaje="nPalabra a buscar y errores:"; String leer = Leer("archivo.txt"); String introducido=JOptionPane.showInputDialog(leer); JOptionPane.showMessageDialog(null,Errorpalabra(introducido,checar(introducido,leer,1) )); } public static String Errorpalabra(String introducido,String checar){ String PalabraAChecar = introducido; String PalabraElegida = checar; String PalabraAuxiliar = ""; String msj = ""; boolean hecho = false; if(introducido.equals(checar)){ msj = "Sin error."; }else{ if (PalabraElegida.startsWith(PalabraAChecar))
2.
{
PalabraAuxiliar = PalabraElegida.replace(PalabraAChecar, ""); msj += "Falta: "+PalabraAuxiliar+"n" ; PalabraAuxiliar = ""; hecho = true; } if (PalabraAChecar.startsWith(PalabraElegida)) { PalabraAuxiliar = PalabraAChecar.replace(PalabraElegida, ""); msj += "Sobra: "+PalabraAuxiliar+"n"; PalabraAuxiliar = ""; hecho = true; } if (PalabraAChecar.length() < PalabraElegida.length() && hecho == false) { PalabraAuxiliar = ""; for (int i = 0; i < PalabraAChecar.length(); i++) { if (!(PalabraElegida.charAt(i)+"").equals(PalabraAChecar.charAt(i)+"")) { msj += "Letra: " + PalabraAChecar.charAt(i) + " en la posici�n: " + (i + 1) + "n"; } }
3.
for (int i
= 0; i < (PalabraElegida.length() - PalabraAChecar.length()); i++) { PalabraAuxiliar += PalabraElegida.charAt(i + PalabraAChecar.length()); } msj += "Falt�: "+PalabraAuxiliar; PalabraAuxiliar = ""; hecho = true; } if (PalabraAChecar.length() > PalabraElegida.length() && hecho == false) { PalabraAuxiliar = ""; for (int i = 0; i < PalabraElegida.length(); i++) { PalabraAuxiliar += PalabraAChecar.charAt(i); if (!(PalabraElegida.charAt(i)+"").equals(PalabraAChecar.charAt(i)+"")) { msj+= "Letra: " + PalabraAChecar.charAt(i) + " en la posici�n: " + (i + 1) + "n"; } } PalabraAuxiliar = PalabraAChecar.replace(PalabraAuxiliar, ""); if (PalabraAuxiliar.length() > 0) {
4.
for (int i
= 0; i < PalabraAuxiliar.length(); i++) { msj += "Letra: " + PalabraAuxiliar.charAt(i) + " en la posici�n: " + (PalabraElegida.length() + i + 1) + "n"; } } PalabraAuxiliar = ""; hecho = true; } if (PalabraAChecar.length() == PalabraElegida.length() && hecho == false) { for (int i = 0; i < PalabraAChecar.length(); i++) { if (!(PalabraElegida.charAt(i)+"").equals(PalabraAChecar.charAt(i)+"")) { msj += "Letra: " + PalabraAChecar.charAt(i) + " en la posici�n: " + (i + 1) + "n"; } } PalabraAuxiliar = ""; hecho = true; } }
5.
return msj;
} public static String Leer(String archivoPath){ File archivo = null; FileReader fr = null; BufferedReader br = null; String txt = ""; try { archivo = new File (archivoPath); fr = new FileReader (archivo); br = new BufferedReader(fr); String linea; while((linea=br.readLine())!=null) txt = txt+linea+"n"; } catch(Exception e){ e.printStackTrace(); }finally{ try{ if( null != fr ){
6.
fr.close();
} }catch (Exception e2){ e2.printStackTrace(); } return txt; } } public static String checar(String introducido,String leer, int opcion){ String PalabraAChecar = introducido; String Letras = ""; String msj = ""; String palabras = leer; String palabra[] = palabras.split("n"); int[] palNum = new int[palabra.length]; int contador = 0; for (int pal = 0; pal<palabra.length; pal++) { if(introducido.equals(palabra[pal])){ if(opcion == 0){ msj = "Has escrito correctamente la palabra:nn"+introducido; }else{ msj = introducido;
7.
}
break; }else{ for (int i = 0; i < PalabraAChecar.length(); i++) { for (int j = i + 1; j < palabra[pal].length(); j++) { Letras = palabra[pal]; if ((Letras.charAt(i) + "").equals(PalabraAChecar.charAt(i) + "")) { contador++; break; } } } palNum[pal] = contador; contador = 0; } int posicion = mayor(palNum.length, palNum,palabra); if(opcion == 0){ msj = "Escribiste mal la palabra:n"+introducido+"nnLa m�s cercana es:n"+palabra[posicion]; }else{ msj = palabra[posicion];
8.
}
} return msj; } public static int mayor(int n,int[] ns, String[] sugerencia) { int mayor = -99, i, posicion = 0; for (i = 0; i < n; i++) { if ((mayor < ns[i]) && (ns[i] != 0)) { mayor = ns[i]; posicion = i; } } return posicion; } }
Descargar ahora