1,678 Posted Topics
Re: you need a keyboard first. Then you type in their password and click enter. | |
Re: [QUOTE=scuzzo;1171982]How do I analyze for (int i = 1; i <= n; i=2*i) for (int j = 1; j <= n; j++)[/QUOTE] It's pretty easy. The second loop obviously runs O(n) and as a hint for the first loop, pick some arbitrary values for n, then write out how many … | |
Re: [CODE] for (int i=0; i < size; i++) { sum += scores[i]; }[/CODE] Try that. The variable "i" is already incremented automatically because you put "i++" in the for loop. You need to index your scores array at every index. So the above loop will do that. | |
Re: An easy question, but one that you won't get an answer to from me since we don't do homework for others. Read the rules. | |
Re: If you think that "\n" is a terminating null, it is not. "\0" is the terminating null. When you declare a char array, such as char mySchool[10] = "stuff" the compiler adds in the "\0" for you. So strlen starts at 0 for length and counts any character under it … | |
Re: Both errors are self explanatory. Read the error message. You can't instantiate (i.e. create an Object of) an abstract class type. Read the java tutorials about abstract classes for more information on why you can't do that. For the "Units" error message it simply can't locate any class definition for … | |
Re: Where does that swap function come from. I'm betting that neither ctype.h, string.h, nor stdio.h define a function which matches the method header that you attempted to use in your call to swap(). | |
Re: If it is working outside of the update() method, but not inside of the update() method, (and you're sure the update method is actually being called) then it is due to a side effect. So some other condition which is either true before the update() method gets called, or which … | |
Re: [QUOTE=mabrookes;1172987] Just out of curiosity, I originally tried to allow the user to type yes or no before realising I just dont know how to do this and stuck with a boolean type, is there a simple way of doing this and if so, could you just let me know … | |
Re: Paste us the error message. | |
Re: You could just do either of these [CODE] yourString = "This is Kyle's string" yourOtherString = 'This is Kyle's string' [/CODE] | |
Re: Is this supposed to be in a particular language? or pseudocode? And you need to show work, or ask a more specific question about what you don't understand, to receive help. | |
(NYC) This weekend. I don't know what I'm going to be doing there yet, though. But it should be fun! If anyone has any non-touristy suggestions, they would be welcome. | |
Re: [CODE] for(int i=1; i<listCount&¤t.getNext()!=null; i++) { current=current.getNext(); } temp.setNext(current.getNext());[/CODE] Your for loop exits once current.getNext() == null. So it is no wonder that when you then reference current.getNext() a few lines of code later, you get a NullPointerException. | |
Re: You should consider jwenting's reply, but if you only care about the extension for some reason, and don't care about the contents, you can use a Regular Expression to check. Something like [B](.*)(\.txt)$[/B] might work. I haven't tried it but you can check out Regular Expressions tutorial [URL="http://java.sun.com/docs/books/tutorial/essential/regex/bounds.html"]here[/URL]. The idea … | |
Re: [url]http://java.sun.com/docs/books/tutorial/java/javaOO/classvars.html[/url] | |
Re: You don't need to pass parameters, just use class level variables (like you did in your example). Override the paintComponent method and use those class variables to control what gets painted. | |
Re: What are you trying to do? You can use the [URL="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/System.html"]System[/URL] class but there is little reason you should ever do so. The only reason I can think that I ever use it is because of System.out.println() for output. | |
Re: Look up Serializable. You could write your base GUI Object out to file and then read it back in via Serialization. | |
Re: Paste the error message. Someone else might spot it, but I see nothing, the error message will make it obvious. I think the cannot find symbol message means you tried to use a variable or method that doesn't exist. | |
Re: Dani and Narue are the same person. My evidence is that they are both women. I submit this to all of you so you can congratulate me. | |
Re: [CODE]// get input up here into char variable 'userInput' if (Character.isDigit(userInput)){ //do something } else System.out.println("That wasn't 0-9...");[/CODE] | |
Re: [QUOTE=Wikipedia]An obvious way to generate permutations of n is to generate values for the Lehmer code (possibly using the factorial number system representation of integers up to n!), and convert those into the corresponding permutations. However the latter step, while straightforward, is hard to implement efficiently, because it requires n … | |
Re: No, we don't do homework or any work for others. Read the rules in the announcement at the top of the forum. | |
Re: Agreed; there should be a better facility for posting, reviewing, and editing tutorials before a final revision drops it into some permanent area. You can't really stop people from posting their tutorials on numerous sites, although you can prevent people from stealing tutorials from elsewhere and posting them here. | |
Re: You'd have to declare the constructor of Polynomial as taking type MyDouble, not type double as you have it declared now. Then you would have to set "a = tempA" and so on. Also, can you post your MyDouble class? | |
Re: So this is the [URL="http://www.daniweb.com/forums/thread269801.html"]same exact question[/URL] you posted in a different thread 6 hours ago, that I answered then? May I ask why you would ignore my advice in that thread, then post another one with the same question instead? Nobody is going to do your homework for you. … | |
[url]http://theoatmeal.com/comics/computers[/url] I found that pretty funny, as well as the oatmeal's comic about printers. It might be old news to some of you but I don't frequent the site so I tend to forget it exists until a friend shows me a link. | |
Re: [url]http://www.cs.mun.ca/~donald/bsc/node13.html[/url] I agree with Rashakil that it is difficult to convey the concept without simply writing a real program. Here is a situation that might make sense as far as why data encapsulation is useful. Lets say you want to put the car in reverse, so you have a variable … | |
Re: You can easily write this with either a for loop or a while loop. You don't need both. Use the % (modulus) operator to tell if a number is even or not. If number % 2 == 0 then it is even. | |
Re: Instead of creating your Donor[] inside of the insertDonors() method, create the array at the top of your class and label it as static. This will make it a class variable which will mean any of the methods in your class can use it. | |
Re: Use a GridLayout. You can change which Layout Manager netbeans is using by right clicking on the form, I think. Your GridLayout should use 1 row and 1 column, that way the buttons will be displayed vertically. Then just use the palette to add 4 buttons. Netbeans will automatically arrange … | |
![]() | Re: Ok. So you are going to need another class such as this [CODE]public class StudentDriver{ static int STUDENT_SIZE = 20; student[] students = new student[STUDENT_SIZE]; int length = 0; //the current size of the array }[/CODE] Then you're going to need an add() method, a remove() method, a get(int index) … |
Re: You should post the code in code tags (unless it is actually too big to reasonably view on a normal size screen) instead of attaching it. I'm assuming that it is pretty small from your project description. Anyway I'll take a look at it since I recently did a similar … | |
Re: That article is kind of amusing; everyone graciously refraining from taking credit except for the marketing woman who is obviously lying since three other accounts contradict her story. | |
Re: The definition above is a better definition for multiprogramming, not multitasking. Multitasking is defined by my OS book as requiring multiple uses - i.e. multiple users get a seamless experience because it appears that all of the CPU resources are dedicated to their use, when in fact this is not … | |
| |
What I've learned so far: An OS may trigger a software interrupt by executing a system call. According to what I read online, this is implemented via special instructions such as INT that the CPU can execute. I also understand how interrupts get handled by the interrupt service routine. My … | |
Re: Use the String class's toCharArray method. Then use a for loop to go through each character in the array. Decide whether or not to increment the character depending on whether or not it is a letter. You can figure out whether or not it is a letter with the Character … | |
Re: He said [I]quick[/I] help. Any time in the first four years would've qualified. | |
Re: So like, the exact thing you [URL="http://www.daniweb.com/forums/thread268220.html"]posted yesterday[/URL]? Except that yesterday you had a different explanation of your problem. I don't know what it means to "make a JButton generate a coding" so you may want to ask clear questions and provide examples, otherwise, you won't get many enlightening replies. … | |
Re: The % or modulus operator gives, as its answer, the remainder after division. So 3 % 3 = 0 and 3 % 2 = 1 and 11 % 3 = 2 | |
Re: Any help you get here follows the same rules. So basically, we consider anything you post here "homework help". Whether or not it is homework really doesn't matter - we're here to help people learn, and we're here to give advice that will help people complete their work themselves, not … | |
Re: wondering_ed, I think you may have just found this out yourself, but basically any time you see " ____ expected " it usually means you forgot a closing bracket } or a closing ) somewhere. | |
Re: Or even more simply you can just click Start->run->cmd (click enter). Then the command window will open. From there lets say you are in the directory C:\Users\Kyle. Typing "cd .\Documents" will take you to the C:\Users\Kyle\Documents directory. Short answer: use the "cd" command to change directory. | |
Re: Code tags. Use them. . and I don't see where your error is. Be more specific. And also, most if not all of the posters here have [I]no idea[/I] mathematically speaking what calculations you need to be using. If you tell us what the calculations are, in math speak or … | |
Re: right click on the desktop click personalize in the bottom left, under "see also" it says "taskbar and start menu" I think you'll be able to get it from there. | |
Re: So do you want the placement of the new line to be randomized? Or do you want it to look a certain way? You've just suggested two different things... |
The End.