1,678 Posted Topics

Member Avatar for bones93
Member Avatar for menaces2323
0
834
Member Avatar for scuzzo

[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 …

Member Avatar for laehc
0
116
Member Avatar for javarook

[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.

Member Avatar for Katana24
0
93
Member Avatar for Saabrina
Member Avatar for piyushhbk
Re: C

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.

Member Avatar for Adak
-1
75
Member Avatar for COKEDUDE

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 …

Member Avatar for daisy192
0
148
Member Avatar for barbn

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 …

Member Avatar for BestJewSinceJC
0
117
Member Avatar for COKEDUDE

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().

Member Avatar for Narue
0
168
Member Avatar for David22

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 …

Member Avatar for ~s.o.s~
0
118
Member Avatar for mabrookes

[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 …

Member Avatar for mabrookes
0
108
Member Avatar for dirnthelord
Member Avatar for johndoe444

You could just do either of these [CODE] yourString = "This is Kyle's string" yourOtherString = 'This is Kyle's string' [/CODE]

Member Avatar for johndoe444
0
75
Member Avatar for Moneek89

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.

Member Avatar for BestJewSinceJC
0
66
Member Avatar for BestJewSinceJC

(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.

Member Avatar for BestJewSinceJC
0
154
Member Avatar for hongil14

[CODE] for(int i=1; i<listCount&&current.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.

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for fishguts

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 …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for Arthas

[url]http://java.sun.com/docs/books/tutorial/java/javaOO/classvars.html[/url]

Member Avatar for BestJewSinceJC
0
82
Member Avatar for mytime19

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.

Member Avatar for BestJewSinceJC
0
91
Member Avatar for C_WHAT_I_DID

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.

Member Avatar for C_WHAT_I_DID
0
91
Member Avatar for dat_geezer

Look up Serializable. You could write your base GUI Object out to file and then read it back in via Serialization.

Member Avatar for dat_geezer
0
105
Member Avatar for justbelieve87

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.

Member Avatar for tiny7415
0
167
Member Avatar for jephthah

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.

Member Avatar for jephthah
3
681
Member Avatar for BuhRock

[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]

Member Avatar for chaospie
0
141
Member Avatar for beforetheyknew

[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 …

Member Avatar for BestJewSinceJC
0
358
Member Avatar for Tarli14

No, we don't do homework or any work for others. Read the rules in the announcement at the top of the forum.

Member Avatar for javaAddict
0
88
Member Avatar for cwarn23

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.

Member Avatar for BestJewSinceJC
0
206
Member Avatar for beGinneR24

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?

Member Avatar for beGinneR24
0
106
Member Avatar for eshirley

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. …

Member Avatar for Katana24
-2
99
Member Avatar for BestJewSinceJC

[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.

Member Avatar for 42below
4
168
Member Avatar for chrisb76
Member Avatar for nickewus24

[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 …

Member Avatar for nickewus24
0
147
Member Avatar for eshirley

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.

Member Avatar for eshirley
0
225
Member Avatar for Jongor

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.

Member Avatar for Jongor
0
112
Member Avatar for charpays

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 …

Member Avatar for BestJewSinceJC
0
213
Member Avatar for soUPERMan

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) …

Member Avatar for BestJewSinceJC
0
1K
Member Avatar for Mz3g

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 …

Member Avatar for abhimanipal
0
215
Member Avatar for mehak_soft

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.

Member Avatar for cwarn23
0
186
Member Avatar for sweetsasthi

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 …

Member Avatar for cwarn23
0
208
Member Avatar for saphireina
Member Avatar for BestJewSinceJC

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 …

Member Avatar for BestJewSinceJC
0
170
Member Avatar for bokoto

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 …

Member Avatar for javaAddict
0
9K
Member Avatar for nabil1983
Member Avatar for emilchacko
1
161
Member Avatar for jxmst32

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. …

Member Avatar for phoenix911
0
366
Member Avatar for jackieoh

The % or modulus operator gives, as its answer, the remainder after division. So 3 % 3 = 0 and 3 % 2 = 1 and 11 % 3 = 2

Member Avatar for BestJewSinceJC
0
107
Member Avatar for Dani

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 …

Member Avatar for BestJewSinceJC
5
4K
Member Avatar for wondering_ed

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.

Member Avatar for BestJewSinceJC
0
158
Member Avatar for cypherinfo

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.

Member Avatar for cypherinfo
0
2K
Member Avatar for simplyflawless

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 …

Member Avatar for phoenix911
0
164
Member Avatar for whughw

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.

Member Avatar for mcastu
0
149
Member Avatar for musikluver4

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...

Member Avatar for BestJewSinceJC
0
5K

The End.