1,678 Posted Topics

Member Avatar for miasuhyla

Your project description literally tells you exactly what you need to do. Create an array of ten integers. Every time you see a 0, increment array[0]. Every time you see a 1, increment array[1]. Etc.

Member Avatar for ejosiah
0
114
Member Avatar for Kellbell147

You're going to have to choose a language and begin learning the basics of that language. Regardless of what language you choose, you will have to learn about loops such as for loops, while loops, do while loops, etc. And of course, if statements, if else statements, etc. Once you …

Member Avatar for Drlionheart
0
323
Member Avatar for Treezwithgunz

Private and Public should be changed to private and public. They are supposed to be lowercase - I think it will give you a compiler error otherwise.

Member Avatar for Jocamps
0
112
Member Avatar for LKH

JoCamps is correct, as a hint for how to display the array backwards, consider writing a for loop that starts at the ending index of the array and goes backwards, printing out the element at each index.

Member Avatar for BestJewSinceJC
0
67
Member Avatar for george21

And what is your question? You said you can't figure out how to display the header only once. What do you mean by that? Because you said 'header' on the one hand, on the other hand, the only area where you are really displaying stuff is the JTextArea, but that …

Member Avatar for BestJewSinceJC
0
111
Member Avatar for low1988

[url]http://java.sun.com/docs/books/tutorial/essential/io/rafs.html[/url] RandomAccessFile will allow you to read from the file but it will also allow you to access it at any point in the file, which it seems you already know. I don't see anywhere where you are *only* trying to read from the file (and if you were trying …

Member Avatar for low1988
0
111
Member Avatar for ramjeev

You can find all kinds of information on these on google. Top down is typically thought of as breaking your problem into subproblems, then breaking these subproblems into further subproblems until you have methods/functions that do one thing well. Bottom up is a bit harder to explain, here is a …

Member Avatar for BestJewSinceJC
0
111
Member Avatar for nblue

[QUOTE=nblue;1011410]a website would store prices on their own database so that people can't mess with the price. [/QUOTE] Professional sites will do that. For example, you aren't going to catch websites for companies like best buy or online businesses such as Amazon that don't check the price against their database …

Member Avatar for nblue
0
129
Member Avatar for axn

You would need a static class variable called 'numberOfBooks' declared as an int and you would simply do numberOfBooks++; every time you added a book to your collection (or whatever causes you to want to increment that category).

Member Avatar for BestJewSinceJC
0
115
Member Avatar for speedy94519

if ((col >= 19 && row < 16 & col >= 21 && row < 18 && col >= 25 && row < 22 && col < 27 && row < 12 && col < 29 && row >= 8) { row < 16 & col >= 21 will not …

Member Avatar for BestJewSinceJC
-1
88
Member Avatar for axn

[QUOTE=JugglerDrummer;1011276]where's ProductDB.inventory declared? you can't just start referencing variables in a function when they were declared in main. You might want to pass it as an argument or declare it somewhere else. :D[/QUOTE] ProductDB is a completely different class than ProductApp, and inventory is a variable in ProductDB that is …

Member Avatar for axn
0
136
Member Avatar for TigerGirl

You just want to count how many times a value is in the linked list? If so, I don't see how your method could work. if (x.value != value){ return 0; } The first time the value isn't at the node, it will stop, even if the value is found …

Member Avatar for TigerGirl
0
107
Member Avatar for kulrik

angle in degrees = angle in radians * 180 / Pi Use that formula to fix the output. Or to fix the calculations in your code, wherever your miscalculations may be if you have any.

Member Avatar for kulrik
-1
85
Member Avatar for oneat

Yes. If you have a GridLayout for your JPanel, and you want to change it so that it can display 2x2, you can use the GridLayout class methods to set it that way. [url]http://java.sun.com/j2se/1.4.2/docs/api/java/awt/GridLayout.html[/url] Look at the setColumns method and the setRows method. If you [I]don't[/I] currently have the JPanel …

Member Avatar for BestJewSinceJC
0
122
Member Avatar for iamsmooth

As you said yourself, "I have a program called IstackInterface.java" . . but in your IArrayStack class, you called it IStackInterface. The two are different because of the capital 'S'. Rename it.

Member Avatar for BestJewSinceJC
0
149
Member Avatar for jimmylee

To do that you will essentially need a ton of logic. For example, 717 would print out seven hundred seventeen whereas 707 would print out seven hundred and seven. You would have a bunch of cases like this. You could begin by examining the similarities instead of the differences: For …

Member Avatar for BestJewSinceJC
-2
85
Member Avatar for Superfat

[QUOTE=Superfat;1008600] Where object1 is the variable. I tried doing that, but i get an error ")" Expected on that line, i suspect that it is because anything that is expected in that first slot is expected inside of quotes.[/QUOTE] Incorrect. Anything in that first argument has to amount to a …

Member Avatar for tonyjaa
0
104
Member Avatar for king_dion

What is this? "addMessage(java.lang.String Why is this so confusing, int xPos, int yPos)" java.lang.String why is this so confusing does not mean anything. And if you are declaring a method, you cannot do so inside another method. 'main' is a method. You can only declare methods inside of your class.

Member Avatar for BestJewSinceJC
0
161
Member Avatar for KimJack

It seems like you already figured out how to get the Characters from the ArrayList and compare them to see if they are the same. Now all you need to do is write a for loop that prints from 1 . . n where n is the number of elements …

Member Avatar for masijade
0
155
Member Avatar for thdinh2009
Member Avatar for Dixtosa
Re: OOP

So a Java interface is more important than a Java Object in your opinion? Since the purpose of object oriented programming is to use Objects? If you are talking about interfaces in general then I take that back, but you specifically mentioned Java interfaces. .

Member Avatar for BestJewSinceJC
0
89
Member Avatar for seo2005

I don't do these conversions the way you do, I do it the first way that is shown on this link. But your way is described there as well if you're having trouble with it. [url]http://www.wikihow.com/Convert-from-Decimal-to-Binary[/url]

Member Avatar for BestJewSinceJC
0
91
Member Avatar for armyofone83

Put in a main method where you think it should go, then repost your code. Also, you posted two classes in one code block. . I hope that your classes are defined in separate files. You can't define two classes (i.e. your car class and your Inventory class) in the …

Member Avatar for BestJewSinceJC
0
142
Member Avatar for george21

You created an inner class that implements ActionListener, and you defined the actionPerformed method for that inner class. But when you make the following statements: [CODE=Java] Chapter165 listener = new Chapter165(inputMile, outputKm); inputMile.addActionListener(listener); outputKm.addActionListener(listener); [/CODE] "listener" is an Object of the class type Chapter165. But in the Chapter165 class, you …

Member Avatar for BestJewSinceJC
0
3K
Member Avatar for bharath1

We don't do people's work for them. If you read the stickies, you'll notice that we're here to help people learn how to do things themselves. Also, since AVL trees are a data structure, I'm sure google already has the wonders you are looking for.

Member Avatar for javaAddict
-2
91
Member Avatar for javed123

It's tricky to help you with this without just giving you a working code sample (which is against the rules here). My first attempt would be a little different than nomemory's. . [CODE=Java]public int getListCount(ArrayList list){ int count = 0; for (every object in list){ if the object is an …

Member Avatar for balumohan2
0
152
Member Avatar for StarZ

[QUOTE=StarZ;1007722]So basically like just copy all the code that setBase had, and put it in with height? I don't mean replacing it I need the two methods. But when I put them together like im pretty much repeating the codes accept one is for base and one is for height. …

Member Avatar for BestJewSinceJC
0
731
Member Avatar for raider650

Then convert the meters into centimeters by dividing height by 100. Then do the same calculation that you already posted.

Member Avatar for BestJewSinceJC
0
43
Member Avatar for sweebez

Vernon and previous posters are correct, keep in mind that the toString() method is usually used to display some description of an Object. You would write your own toString() method if you wanted to do just that . . for example, if you were writing an RPG, your toString might …

Member Avatar for 0805638
0
637
Member Avatar for devidayalan

And as far as I know a wsdl file defines the types of requests that can be made to a web service and the types of responses that will be received for those requests. I could be wrong about that, though. And what do you mean by creating a web …

Member Avatar for pooja.ui7
0
421
Member Avatar for gunjannigam

As far as I recall calling super.paintComponent is going to clear the surface that you are painting on, which is not what you want to do, so I'd erase that line of code. Recompile&run, then tell me what happens.

Member Avatar for gunjannigam
0
257
Member Avatar for BestJewSinceJC

It took me very little effort to put a JComboBox in a JTable so that when the cells in a certain column are clicked, it lets the user choose from a drop down list of items. However, my program requires that the underlying combo box can change, since the list …

Member Avatar for BestJewSinceJC
0
2K
Member Avatar for theo19

What do you mean it won't run because of "public class Calc extends JFrame implements ActionListener"? It looks to me like that is a correct class header, although I haven't written a Java program in awhile. What is the error message the compiler is giving you? Also, you declared your …

Member Avatar for BestJewSinceJC
2
191
Member Avatar for katti.shyam

Yes, you just plug in the numbers. You'll see that when you plug in n = 3, the first part of the formula immediately becomes 9*T(1) so you're practically already done.

Member Avatar for katti.shyam
-1
83
Member Avatar for OffbeatPatriot

Your link to Heisenbugs doesn't exist anymore or was linked incorrectly. [url]http://en.wikipedia.org/wiki/Unusual_software_bug[/url]

Member Avatar for BestJewSinceJC
-1
148
Member Avatar for KimJack

To elaborate on what llemes said (and he is correct), you are trying to use the following method "public Object[] toArray(Object[] a)" which takes an array of Objects, but you are passing in an array of chars. "char" is a primitive type, not an Object, which is why you are …

Member Avatar for BestJewSinceJC
0
226
Member Avatar for leverin4

Since Ezzaral already answered your question - doesn't your code have syntax errors? You didn't specify a type of Exception in the catch block i.e. catch(Exception e). PS, for things like this, usually the best way to find out is to run a small sample program and see what the …

Member Avatar for leverin4
0
67
Member Avatar for TaP1227

Monte Carlo isn't a method, it is the set of algorithms that use repeated random sampling to compute their results, according to wikipedia. So my question is: if that is the case, then don't you have to design an algorithm to estimate the # bottles of Boost before you even …

Member Avatar for TaP1227
0
71
Member Avatar for lloydsbackyard

[url]http://www.google.com/search?q=java+image+on+JPanel&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a[/url] There are a ton of examples on the web. . "window" is either a JFrame or JPanel though, and Image is the name of the Java class. You can also check out the java tutorial on Images. . [url]http://java.sun.com/docs/books/tutorial/2d/images/[/url]

Member Avatar for Ezzaral
0
207
Member Avatar for jralexander137

Just use a for loop that cycles through the entire String one character at a time. for (int i = 0; i < string.length(); i++){ 1. get the current character 2. attempt to parse this character into an integer. 3. add the integer you just parsed into the linked list. …

Member Avatar for BestJewSinceJC
0
120
Member Avatar for Ashwin Vasnai

You'll need to clarify your question. Since the JTextArea displays text, I'd imagine it would go something like jTree.getItemAt(index).toString() or something like that. Then you'd append the text to the JTextArea using whatever the correct method is (probably append)

Member Avatar for Ashwin Vasnai
0
89
Member Avatar for sarath.koiloth

Yeah interfaces are somewhat similar - if your class "implements" the interface, it forces you to include those methods that are defined in the interface itself.

Member Avatar for JamesCherrill
0
133
Member Avatar for nihao

I could be wrong, but my best guess is that if you want to change the file's last modified time (to something arbitrary), this would be OS dependent. edit: sorry, just realize that doesn't really help you very much either way. Tired over here, I was pretty much thinking out …

Member Avatar for nihao
0
141
Member Avatar for Shigekazu

If you add components after your GUI is initialized (which it looks like you're doing) I think you need to call revalidate() or validate() on the JPanel or JFrame. If you read the revalidate method documentation it might make it clear which one needs to happen, if at all. Or …

Member Avatar for quuba
0
162
Member Avatar for opethcire316

Whenever you do projects like that you should consider all of your options: for example, is your input file guaranteed to input only integers or characters? If so, you could quit on any input that is not an integer, and this would be no different than quitting when you see …

Member Avatar for opethcire316
0
3K
Member Avatar for ajeet choudhary

Either use wikipedia or ask a more specific question. I don't mean to be rude, it's just that any information I can provide can just as easily be found on wikipedia - I just checked the articles out and they aren't very confusing, but if you have any more specific …

Member Avatar for masijade
0
263
Member Avatar for vileoxidation

One thing I noticed right away is that your insertAtIndex function does not have a for loop. If you want to insert a node at the fifth index, then you will need a for loop and you will have to go to the 'next' node four times. (It looks like …

Member Avatar for vileoxidation
0
286
Member Avatar for Trekk

[QUOTE=Trekk;993144]I placed the loop in there to keep the program "asking for inputs" until a condition was met (i.e. User inputs 'E' or 'e'). But obviously i might have missed something[/QUOTE] Yes, but a while loop runs until the condition is no longer true. For example: [CODE=Java] int i = …

Member Avatar for BestJewSinceJC
1
118
Member Avatar for MrNoob
Re: Idea

What the poster above posted might look confusing, but what he is saying is a good way of doing this: Each String in the array will be the "name" of the index it is at. So index 0 of the array is named zero, and so on. This means in …

Member Avatar for Anjoe18_Edica
0
225
Member Avatar for KimJack

Black box testing would involve trying to break your code by giving it invalid inputs and making sure it handles them appropriately, as well as giving it valid inputs and making sure it comes up with the right result. So I do not think your code counts as black box …

Member Avatar for BestJewSinceJC
0
124

The End.