2,777 Posted Topics
Re: I don't know if the DB program knows how to read a DB that is inside of a jar file. | |
Re: Can you post the code you are having problems with? pseudo code: begin loop read number print "YES" end loop | |
![]() | Re: Print out the contents of appname after it is read into to see if an empty String has been read. Be sure to put delimiters around appname when you print it so you can see if it is empty: (">"+appname+"<"). |
Re: Can you insert some input into the program (not read a from file) using a StringReader and execute the program using the input from the String. Post the output and add comments to the output showing what output you want to get instead? | |
Re: What's the full text of the error message? Add a call to the printStackTrace() method to the catch block. | |
Re: How would you do it manually? If I were to give you numbers one at a time (Like is done in the loop in the program) How would you sum up the numbers keeping a running total as you got the numbers? How would you keep track of (count) the … | |
Re: There are many here who will try to help you. Please post some specific questions and the pseudo code for the design you are working on. | |
Re: what happens when you tried it? I've never tried doing that specific thing. Most of my changes to the .java.policy file was to give permissions to applets. | |
Re: > everything I have tried is not working. Could you make a small, simple complete program that compiles, executes and shows the problem? | |
Re: > the output I am getting is not correct. Can you post the console contents from when you execute the program that shows what you entered and what the program printed out? Can you explain what the two loops at lines 39 and 40 are supposed to do? | |
Re: What code is in the two main() methods? Any class can have a main() method. The class used to start the execution of a program does not have to be named: Main. I personally do not create a separate class to house a main() method that creates an instance of … | |
Re: This sounds like a very advanced project for a beginner. | |
Re: > the parentheses are ending the statement prematurely. Start with the first ( and find its pairing ). Where is that )? It should be at the end of the conditional expressions used by the while statement. | |
Re: Also posted at:http://www.javaprogrammingforums.com/java-theory-questions/17662-need-help-splittin-java-string.html#post75571 http://forums.devshed.com/java-help-9/need-help-in-swing-930723.html | |
Re: How about moving the code out of the main() method to the constructor? Or make t final so it can be used in the listener method. | |
Re: > how do I add multiple numbers Make a loop that asks for a number, reads the number, does a computation with the number and then loops back to the top where it asks for the number again. To end the loop either ask the user before entering the loop … | |
Re: Try debugging the code by printing out the values of the variables being used in the code. What is: str[0], str[i-1] and str[i] Why is this test in the code: if(i == 1022){ | |
Re: Can you explain what your problem is? If there are errors, please copy the full text and pasted it here. | |
Re: The Applet class extends Panel which extends Component and could be added like any other Component to a Container like JFrame. Does the applet use any Applet or AppletContext methods? Depending on which ones, you may be able to provide the services that the browser provides by setting the AppletStub … | |
Re: Can you explain what the code does and why you think there is something wrong? Post the code's output and explain what is wrong with it. | |
Re: 6) and 7) make sense. You could use String[1000] also. The extra unused slots in the array take up very little room. You will need an int value as an index that points to the next empty slot in the array. As you add Strings to the array, increment the … | |
Re: > what are my errors ? Please post the full text of any error messages so we can see them. Or if there are no error messages, please explain your problem. The formatting for the posted code is very bad. Each nested pair of {}s should be indented 3-4 spaces … | |
Re: Is this the same problem: http://www.daniweb.com/software-development/java/threads/433586/keep-getting-errors-for-my-program#post1860452 | |
Re: Could you rewrite the code so that it includes the input it is reading? For example replace the DataInputStream class with a Scanner class and create the Scanner object with a String instead of System.in = new Scanner("the input for the class here\nwith lines\nand more lines\n"); That will make it … | |
Re: You will have to write some code to extract the numbers,the operators between the numbers and then do the arithmetic represented by the operators. The String class has many methods that should help you. | |
| |
Re: > show the maximum amount of time possible for each. Can you explain what that means? > how to get the days, hours, and minutes to show the remainder. Can you explain what the "remainder" is? Is it like this: 10/3 = 3 with a remainder of 1 | |
Re: Work on the requirements one at a time: > . Count of numbers input Define an int variable as a counter and set it to 0. Be sure to define it outside of the loop Add one to the counter as each number is input. | |
Re: Define where you want to separate the input string into the desired subparts. Look at the String class's methods for ways to find the boundary between one part and another and for methods to extract the desired substrings into separate Strings. | |
Re: What is the full text of the command you entered ? On windows: To copy the contents of the command prompt window: Click on Icon in upper left corner Select Edit Select 'Select All' - The selection will show Click in upper left again Select Edit and click 'Copy' Paste … | |
Re: Enclose the code you want to repeat in a loop like a while() loop. while(someCondition) { < current code here > } // end while() To exit the loop: Change someCondition to false or use the break statement. | |
Re: > how can I do this from the text file Read a line from the text file, extract the first letter of the line and use an if statement to test it and do what it requests to be done. | |
Re: Here is a link to the tutorial's big index. A good place to start reading. http://docs.oracle.com/javase/tutorial/reallybigindex.html | |
Re: Can you explain what happens when you try to compile and execute the program? What does "not working" mean? Post any error messages here. | |
Re: > cannot find symbol : variable myCircle Where is the variable: myCircle defined? The compiler can not find its definition. You must define a variable BEFORE you try to use it. Same with the other "cannot find" messages. | |
Re: Where does the code assign any value to the variable: total? Its default value is null. Why is total defined as an Object? Shouldn't it be a numeric type? | |
Re: What is printed when the code is executed ` System.out.println(OptionChoosed);` What are the values 0 and 1 that you are comparing against? The code should use the variables defined in the JOptionPane class vs hardcoding numbers? | |
Re: What is a "majority" element? Can you explain what the problem is with the posted code? Does the code compile and execute without errors? What does the program print out? What should it print out? Have you tried debugging the code by adding println statements to print out the values … | |
Re: Wrong forum. This one is for java. | |
Re: Where is the infinte loop happening? In what method in what class? Add some println statements that shows the execution flow so you can see where the code is executing and where the loop is. For solid code and better bug detection you should add a default case to the … | |
Re: The question is too general to be answered. You need to be much more specific about the program you want to write and show some effort by posting the code you are having problemw with. | |
Re: Can you post the code you are having problems with? | |
Re: See the tutorial: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/for.html What collection or array do you want to get elements from? | |
Re: [QUOTE]help me in completing my program[/QUOTE] Where is the staring of the code? Please ask specific questions about your problems. | |
Re: How is this different from executing the javac and java programs with the classes to be tested? | |
Re: > java.lang.ArrayIndexOutOfBoundsException: 0 What line does that error happen on? The message says that the array is defined with 0 elements and does not have a first element at index=0 | |
Re: Also the message: No is not too useful. Better for debugging would be to print out the values of line and r.password so you cann see what the computer is seeing so you'd know why the if test failed. | |
Re: What is getValue() defined to return? Can you post a small complete program that generates the compiler error? | |
Re: How does that related to java programming? You might try a javascript forum. | |
Re: Also posted at: http://www.javaprogrammingforums.com/whats-wrong-my-code/17524-grading-program.html |
The End.