458 Posted Topics
Re: Instead of giving us th broad description of what you were supposed to do to start out with, where we have to figure out each and everything like the logic, methods, variables etc., give us directly the error that the compiler is throwing at you or tell us where you … | |
Re: I am not sure about this, but does PERT/CPM fall under discrete maths ? If yes these are used in project scheduling and management and hence in the s/w made for such systems. | |
Re: Thats because of this: [code=java] fermi value=new fermi(); [/code] Everytime you call the [icode]result[/icode] method you create a new fermi instance and assign it's reference to the same [icode]value[/icode] variable so that the previous total play, total win and total lose get washed off. In order retain the previous results … | |
Re: The problem is you declare 'give' inside this while loop [icode]while(quit !=-1)[/icode] but then this loop ends at the '}' after [icode]give.totalPlay();[/icode], so that the 'give' variable goes out of scope and at this statment [icode]JOptionPane.showMessageDialog(null,"total play is "+give.totalPlay()+"\ntotal win is"+win+"\ntotal lose is"+lose);[/icode] the compiler cannot find a declaration for … | |
Posting in the Java forum of the community I have seen one thing happen more often than not. I have seen posters post onto a thread that has been solved years ago, but just weren't marked as solved by the OP. Take for example [URL="http://www.daniweb.com/forums/thread5399.html"]this[/URL] recent thread in the forum. … | |
Re: [code=sql] Select resortname from table2 where resortid = (select MAX(resortid) from table1) [/code] Try this. | |
Re: >I hate how resource hungry some java programs can be Thats the thing from the Ice age. Now Java can really be as fast and efficient as some of the native language code. >I did some searching around and found two books Hmmm... Did you not search the sticky thread … | |
Re: This means your program is getting stuck up at some place, so there may be some exception causing this. Put a try-catch block and print a stack trace in the catch clause, you will soon know what happens. | |
Re: Have you understood the question yourself ? What do you mean by this: [QUOTE]Describe a recursive algorithm for enumerating all permutations of the numbers {1,2,...,n}[/QUOTE] I don't think so, with the way you have copy-pasted the assignment-looking statement. If you haven't understood the question in the first place you cannot … | |
Re: I guess yes, but he would have been much happier if you would have dropped the multiple character typing (???) habit of yours too. That too is a symbol of chat/IM speak. | |
Re: I don't think so, but java docs can. Check the java docs for the methods and try implement the methods yourself those are some pretty basic ones. | |
Re: [code=java] System.out.println("Enter the name of the lab this computer is located: \t"); } [/code] Remove the '}' in this line that is what causes the previous while loop to terminate "prematurely" and on the next '}' it terminates the method/class, so that the next statement "appears" to the compiler out-of-place. | |
Re: @svincio: Did you happen to see the date of the previous post ? Way too back isn't it ? Perhaps start a new thread. @Daniweb Community : This is what happens when a solved thread isn't mark solved, people keep posting there for ages. | |
Re: Your question is a little confusing but from what I have gathered here's what you need to do: Take several strings from a user sort them alphabetically and show them, in a text area, in sorted order. If yes, you can use the [icode]compareTo()[/icode] method of the String class for … | |
Re: What is the definition of [I][B]relevant[/B][/I] ? If you use the LIKE clause, you will get only those records in which the filed contains the content of the LIKE clause. So if you have all records containing the content you want, I don't think you can order them by any … | |
Re: Check out the docs for java.util.Vector, where do you find the method getStandardDeviation() in it ? Also all the other errors are pretty straight forward, the compiler gives a reason for the error, the line number where the error occurs in your program and the shows the line too, you … | |
Re: If it is profiling that you need to do on your program/application and not only the overall time required for execution, I would suggest you to use the profiling tool accompanied with modern day IDEs such as NetBeans. But if it is just the overall execution time that you require … | |
Re: There are three methods in MouseEvent which could be of particular help, [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/awt/event/MouseEvent.html#getX()"]getX()[/URL], [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/awt/event/MouseEvent.html#getY()"]getY()[/URL] and [URL="http://java.sun.com/j2se/1.4.2/docs/api/java/awt/event/MouseEvent.html#getPoint()"]getPoint()[/URL], getPoint returns the X,Y position relative to the source component while getX() returns the X coordinate and getY() returns the Y coordinate. Now what you could do is, divide the image in sections for … | |
Re: [code=java] for (guesses=0; guesses <= ichances; guesses++); [/code] The semi-colon [;] at the end of the for loop makes this happen, remove it. | |
Re: You could attack this solution in this way: consider the x value that produces the maximum value for the function as a value that is to be "searched". And start off with an algorithm one like the binary search. To put this into perspective, suppose 0-40 is your range set … | |
Re: start a new thread probably this one's already more than 3 years old. | |
Re: Strings in Java cannot be compared using '=='. You need to use the [icode]equals[/icode] method of the String class. So basically [code=java] if (paragraph == "\n\n") [/code] convert this to [code=java] if (paragraph.equals("\n")) [/code] Also are paragraphs always going to be with two new lines ("\n\n"), if not what you … | |
Re: Suppose that you are taking the username as input from the user in the Login page and passing it to the Login page's target page, then in the target page writing the belowwritten code would save the username in the [icode]session[/icode] variable, which will be available to you throughout the … | |
Re: @curtissumpter: what do you think you are doing giving people ready made code, this forum boasts an attitude opposite of that. Tell the OP the logic mentioning the way to go about, or at the most the psuedocode, but not written code in any manner. @peedi : Use a stack … | |
Re: And why would you want to do anything like that ? | |
Re: The forum announcement [URL="http://www.daniweb.com/forums/announcement8-2.html"]here[/URL] suggests that no one here would be willing to provide you homework help unless you show some effort. But I ain't much of an obeyer of the rules myself....sssssshhh.... *talking in a low voice* I can help you solve these assignments, even if you don't show … | |
Re: Check [URL="http://www.daniweb.com/forums/thread99132.html"]here[/URL]. aargh.... how do people miss this thread ? | |
Re: How will we know, how you can do that, unless you post the relevant code and mention what problems do occur ?. Think before you post. | |
Re: Yes recursion is very efficient in case of trees. I suppose from your question in the first post that you want to know how to load the tree. Well this depends on what purpose you want to use the tree for. If you are using the tree for sorting, you … | |
Re: And where's the code ? Seriously, I have never felt so much trouble making the sense of any post here. Do you have a serious question toask here or do you have the habit of occassional blabbering ? | |
Re: I don't find anything wrong in this piece of code. Post more code and the entire error trace to let us know more. | |
Re: What you could do is : 1. Ask the string to be entered. 2. Trim it so that any leading/trailing spaces are removed. 3. Split it on the basis of (internal) spaces so that you can get the individual words in it. 4. Count the number of words. 5. Count … | |
Re: [QUOTE=hell_tej;819487]Enjoy Java Programming:)[/QUOTE] How will he, when you won't allow him to by giving readymade code pieces ? | |
Re: @manojjena1982 : Giving away readymade stuff like that wihtout attempting to make the OP learn isn't considered a good habit here, try to correct yourself in the future. | |
Re: What are the criteria that one could be selected for the title. (MotM) Is it that it is only the number of posts that count ? Posting in the Java community I have come across several members that might not have those many posts, but have been a real help … | |
Re: [QUOTE=hell_tej;819469]Your Error in JOptionPane code write That code as Follows JOptionPane.showMessageDialog((Component) null, "Sum is:-", " your sum is " + String.valueOf(sum),JOptionPane.PLAIN_MESSAGE);[/QUOTE] Is this not exactly the same as what has been adviced in the previous post ? Whats the point of this then ? | |
Re: Go surfing. Do some research on your own, then come back tell us what you feel and then maybe we;ll let you know what we feel. | |
Re: You cannot call a class from within another class, but what you can do is call a public method of one class from another class. Here's an exmaple: [code=java] public class Demo{ public void callMe(){ // callMe code } } [/code] Now we will call the [icode]callMe[/icode] method in another … | |
Re: what dickersonka wants to say is, you do not need to create an object of Car within itself. What you can do is simply push the code of [icode]newCar[/icode] into the constructor of the Car. Meaning the four statements where you pop up an input dialog in front of the … | |
Re: From what I get from the first glance at your program is that, your for loops are working correctly and you are creating 10,000 Voter objects but in the first for loop you are assigning all the 3500 objects to the same reference v1 in the next you are assigning … | |
Re: I assume here the numbers are the score over which you need to make an average, "-1" is the termination indicating character and the first string in a line is the name of the person. Well, what you can do here is read all the lines entirely from the file … | |
Re: Are you sure you should be posting this here and not on the C# forum ? | |
Re: [QUOTE=JamesCherrill;817905]I suspect that 11 factorial is greater than the maximum value of a Java int (about 2,000,000,000), so you'll have to use a different data type (eg long) to go bigger.[/QUOTE] You haven't even taken care to look at what he is using for the result of the factorial before … | |
Re: > I must also format the pay as currency Do you mean having decimal points ? If yes then you could define your pay variable as float/double according to your requirement. > Build an exit key What you could do is have a menu printed at the start of every … | |
Re: So then when the line runs longer than the maximum width allowed for the post screen, how do you plan to show that ? If you use horizontal scroll bars for it, then lines can become too too long. This again causes problem to read, as one has to keep … | |
Re: You can print out the output in CSV (comma-separated-values) format and then open this file in a spreadsheet application like Excel. If this is not what you want, detail out your problem. | |
The End.