![]() |
![]() | #1 |
Silence Join Date: 11 2004 Location: back to meta level
Posts: 3,926
Blog Entries: 3 Downloads: 1 Uploads: 0
Reputation: 202 | 4 | ![]() http://coltrane.wiwi.hu-berlin.de/le...omework_1.html deadline is knocking & i can't deal with last probs. 39 errors [email protected]:~/homework/MAT# javac SearchResults.java [email protected]:~/homework/MAT# javac LilitHw1.java LilitHw1.java:27: cannot resolve symbol symbol : variable Konsole location: class LilitHw1 auswahl = Konsole.readInt("Please chose an option"); ^ 1 error [email protected]:~/homework/MAT# java LilitHw1.class Exception in thread "main" java.lang.NoClassDefFoundError: LilitHw1/class if smb could help asap, i'll attach the file. thx voraus |
![]() |
![]() | #2 | |
★★★★★★★★★★★★★ Join Date: 08 2004 Location: London, UK Age: 41
Posts: 16,531
Downloads: 8 Uploads: 0
Reputation: 482 | 7 | ![]() Quote:
hey Moonlight! how is it going/ hope all is well! ![]() I'll ask our guys in software what solution they have to your issues ... unfortunately, the filed I am in is a little bit different ... it's silicon ip field and semiconductors - I am not a coder ![]() cheers! Hrachya
__________________ Мадмазель, Медам, Месье! "Глория" меняет курс и направляется в Кейптаун! Кому это не нравится будет расстрелян на месте. (с) http://texneg.livejournal.com | |
![]() |
![]() | #3 |
★★★★★★★★★★★★★ Join Date: 08 2004 Location: London, UK Age: 41
Posts: 16,531
Downloads: 8 Uploads: 0
Reputation: 482 | 7 | ![]()
перепутал приват с эфиором - бывает ... ![]() |
![]() |
![]() | #4 |
Silence Join Date: 11 2004 Location: back to meta level
Posts: 3,926
Blog Entries: 3 Downloads: 1 Uploads: 0
Reputation: 202 | 4 | ![]()
thx considering ![]() Code: class LilitHw1 { //To change the search term, just change this static String Term = "implementation"; public static void main(String[] args) { double eingabe1; double ergebnis = 0.0; int auswahl; System.out.println("\nDesktop Search beta version"); System.out.println("\nThis program allows textual search for keywords in .doc, .txt, .html,"); System.out.println(" files locally stored in your computer.\n"); System.out.println("The current search term is fixed in this version and is: " + Term + ". "); do //User manu { System.out.println("\n\n\nDesktop Search beta version"); System.out.println(""); System.out.println("(1) PDF"); System.out.println("(2) TXT"); System.out.println("(3) DOC"); System.out.println("(4) HTML"); System.out.println("(0) Ende"); auswahl = Konsole.readInt("Please chose an option"); switch (auswahl) { case 1 : { System.out.print("\nThe PDF search result is : "); runPDFsearch(); break; } case 2 : { System.out.print("\nThe TXT search result is : "); runTXTsearch(); break; } case 3 : { System.out.print("\nThe DOC search result is : "); runDOCsearch(); break; } case 4 : { System.out.print("\nThe HTML search result is : "); runHTMLsearch(); break; } case 0 : { System.out.println("\ncaio!"); break; } default:{ System.out.println("\nInvalid choice.\n"); } } }while (auswahl != 0); } private static void runPDFsearch() { int Lines = SearchResults.pdfResultsFN.length; System.out.println("There are " + Integer.toString(Lines) + " matching lines\n\n"); for(int count=0; count < Lines; count++) { System.out.print(SearchResults.pdfResultsFN[count] + " : " ); ProcessLine( SearchResults.pdfResultsTL[count] ); } } private static void runTXTsearch() { int Lines = SearchResults.txtResultsFN.length; System.out.println("There are " + Integer.toString(Lines) + " matching lines\n\n"); for(int count=0; count < Lines; count++) { System.out.print(SearchResults.txtResultsFN[count] + " : " ); ProcessLine( SearchResults.txtResultsTL[count] ); } } private static void runDOCsearch() { int Lines = SearchResults.docResultsFN.length; System.out.println("There are " + Integer.toString(Lines) + " matching lines\n\n"); for(int count=0; count < Lines; count++) { System.out.print(SearchResults.docResultsFN[count] + " : " ); ProcessLine( SearchResults.docResultsTL[count] ); } } private static void runHTMLsearch() { int Lines = SearchResults.htmlResultsFN.length; System.out.println("There are " + Integer.toString(Lines) + " matching lines\n\n"); for(int count=0; count < Lines; count++) { System.out.print(SearchResults.htmlResultsFN[count] + " : " ); ProcessLine( SearchResults.htmlResultsTL[count] ); } } //This will do all the printing with the '...' if needed private static void ProcessLine(String ProcessString) { int Length = ProcessString.length(); int Location = FindTerm(ProcessString); if(Location < 0 || Location > Length){ System.out.print("Error\n"); System.out.println(Location); return; } int End = Term.length() + Location; if (Location > 10){ System.out.print("..."); System.out.print(ProcessString.substring(Location-10, Location)); }else{ System.out.print(ProcessString.substring(0, Location)); } System.out.print(ProcessString.substring(Location,Location+Term.length())); if ((End + 10) < Length){ System.out.print(ProcessString.substring(End, End+10)); System.out.print("..."); }else{ System.out.print(ProcessString.substring(End, Length)); } System.out.print("\n"); } //This will find an index in the string where the term starts private static int FindTerm(String ProcessString) { int iRet=-1; //Put into a char array to get at individual bytes int Length = ProcessString.length(); char[] ProcessCharArray = ProcessString.toLowerCase().toCharArray(); //same as above int TermLength = Term.length(); char[] TermCharArray = Term.toLowerCase().toCharArray(); //look for the term for(int processcount=0; processcount < Length; processcount++) { //find the begining if (ProcessCharArray[processcount] == TermCharArray[0]){ iRet=processcount; //see if the whole term is found for(int termcount=0; termcount<TermLength; termcount++){ if (ProcessCharArray[processcount+termcount] != TermCharArray[termcount]){ //keep trying iRet=-1; } } if(iRet == processcount){ //found it return iRet; } } } //didn't find it return iRet; } } |
![]() |
![]() | #5 |
Профессор Join Date: 07 2004 Location: Own world Age: 39
Posts: 3,656
Downloads: 22 Uploads: 0
Reputation: 228 | 4 | ![]()
I'm not so familiar with java, but the problem is that java "doesn't know" who is "Konsole", check out whether you imported the lib (correctly). By the way, there is a link to the Konsole class implementation, try to place that above the LilitHw1 class. ![]() Ciao. |
![]() |
![]() | #6 | |
Silence Join Date: 11 2004 Location: back to meta level
Posts: 3,926
Blog Entries: 3 Downloads: 1 Uploads: 0
Reputation: 202 | 4 | ![]()
AvDav: thx so so much!! i had even translated german text in the given file, but forgot 2 add Konsole.class (no way 2 replace the hw1). finally no errors, but prog runned only 2 prove me that is working not the way it was supposed to!! after classes i?ll have only some hrs b4 the deadline.. Quote:
| |
![]() |
![]() | #7 | |
Дошкольник Join Date: 08 2004 Location: Oxford Age: 42
Posts: 141
Downloads: 0 Uploads: 0
Reputation: 0 | 0 | ![]() Quote:
| |
![]() |