1,678 Posted Topics

Member Avatar for BestJewSinceJC

Its basically telling me it doesn't know wth the pow() function is. But at the top of the file, I have #include<math.h> so shouldn't that work? And right after I have the #include, I declared the function definition of bintodec, so that isn't the problem either. [CODE]int bintodec(char* array){ int …

Member Avatar for BestJewSinceJC
0
114
Member Avatar for apeaser

Suggestions: 1. Where your LeatherBlueDot constructor (the one with 6 arguments) calls super, the arguments you have in super don't exist. item, name, balls, prices, and subs are not defined in the LeatherBlueDot class. You probably meant to say super( itemNumber, itemName, ballCount, ballPrice, subTotal ); 2. You have the …

Member Avatar for BestJewSinceJC
0
182
Member Avatar for complexcodes

I've never used MouseListener, but your mouseDragged code is wrong. "e" refers to a MouseEvent object, NOT your rectangle. Lets say you had an Object that represented your rectangle, here's what your code should look similar to. [CODE] //Note this shouldn't be of type object, I'm just showing that it …

Member Avatar for BestJewSinceJC
0
573
Member Avatar for chengineer

Chaster is correct, you must define your variables before you use them. A variable in computer science is the same as it is in normal algebra. For example, x and y are commonly used variables in algebra. Similarly, in Java programming, you can define your own variables. To define a …

Member Avatar for masijade
0
147
Member Avatar for Dio1080

[url]http://www.csee.umbc.edu/courses/undergraduate/341/fall08/Lectures/Trees/BST.pdf[/url] Read those lecture notes. They literally have the remove method in them. So assuming the rest of your code is correct, look at the remove method in those notes and compared it to your delete method. Once you figure out whats different, try to figure out why your code …

Member Avatar for BestJewSinceJC
0
164
Member Avatar for sharpst

Write a while loop that loops indefinitely while the user does not enter a specific value. Inside that while loop, you should simply print out something like "Enter your calculation or enter X to quit the program." Then, it should read in the user's input using scanf (might be other …

Member Avatar for ajay.krish123
0
784
Member Avatar for cherryduck

What is UserInput.prompt? Use Scanner to get input from the user, unless you were directed otherwise by your instructor. For example, Scanner userInput = new Scanner(System.in); //System.in is connected to the keyboard by default, so the statement above will create a Scanner object called userInput that allows you to read …

Member Avatar for cherryduck
0
215
Member Avatar for dmanw100

Its because hasNextLine() will return true if there is a next line, even if that line does NOT contain any information. In other words, if there is a newline character, hasNextLine() will return true. Whereas hasNext() will only return true if there is a next token. A token is defined …

Member Avatar for BestJewSinceJC
0
121
Member Avatar for americaneagl

One good way to do this would be the following [CODE] //assuming your Scanner object is called input do{ int choice = -1; System.out.println(//Print out your choices here); if(input.hasNextInt()){ choice = input.nextInt(); //call some method that does the calculations here. // the method will take 'choice' as its argument //so …

Member Avatar for BestJewSinceJC
0
326
Member Avatar for yinfu89

[CODE] #include <stdlib.h> #include <stdio.h> int main(){ int nrEvens = 0; int nrOdds = 0; int nrInputs = 0; int currentValue; while(nrInputs < 20){ printf("Enter a number: "); scanf("%d", &currentValue); if (currentValue % 2 == 0){ nrEvens++ } else{ nrOdds++; } nrInputs++; } printf("There were %d even values entered and …

Member Avatar for ddanbe
0
133
Member Avatar for bahr_alhalak

[QUOTE=bahr_alhalak;723545]this is the file bellow .. download and explain what u understand my frind[/QUOTE] This (your existence on this site) must be some kind of a sociology experiment. If so, I guess the goal would be to figure out how much help you can receive from people while disregarding what …

Member Avatar for dickersonka
-1
212
Member Avatar for yawjava

If you are using the LinkedList class, use yourObjectName.remove(index); . It will do all the necessary operations for you, such as making the previous and next nodes point to each other. Since I see that you're not using that class, I would strongly recommend that you do so. Otherwise, you're …

Member Avatar for BestJewSinceJC
0
199
Member Avatar for bahr_alhalak

Are you dense? Stultuske just posted a number of different things to help you. If you don't understand a particular one, try to research it online or ask him to elaborate here. If you don't know any Java at all, which it seems like you do not, find a good …

Member Avatar for dickersonka
0
268
Member Avatar for java-clueless

[QUOTE=java-clueless;722591] [code] //Fig.2.7:Inventory.java //Inventory program public class Inventory { //main method begins execution of Java application public static void main(String[] args) { //You need to create a Scanner object. Below, we create a Scanner object called 'input'. //We use System.in because we want to read input from the keyboard. Scanner …

Member Avatar for java-clueless
0
211
Member Avatar for BestJewSinceJC

I'm confused how GridBagLayout can be used as if it was GridLayout(0,2). For example, I would like to lay out components like this: Label TextFieldForLabel Label TextFieldForLabel Label TextFieldForLabel Label TextFieldForLabel I thought by making a GridBagConstraints() Object, then setting the gridx and gridy variables, this could be accomplished (Java …

Member Avatar for Ezzaral
0
110
Member Avatar for NotThereAnymore

[QUOTE=DaMoogle;721929]the BankAccount constructor should call a deposit method to allow the user to add some money if he or she wants to. However, the parameter which passes the value to the deposit method is not available for this constructor and I know that I can not simply add that parameter …

Member Avatar for dickersonka
0
96
Member Avatar for ranam
Member Avatar for ~s.o.s~
0
115
Member Avatar for yawjava

Considering that there is a class available that will do this for you, LinkedList, I'm assuming this is some sort of assignment? (Which is fine) Anyway... pseudocode to do this -Given the index you want to remove -set the [I]node at the[/I] previous index to point to the node at …

Member Avatar for BestJewSinceJC
0
87
Member Avatar for hikaru1239

You would keep a pointer to the String that you wish to store it in and concatenate your 'new' user entry onto whatever the String's current contents are. OR you could make the function 'return' whatever the user entered as a String, and concatenate that entry with whats stored in …

Member Avatar for Aia
0
83
Member Avatar for joshmo

If it is public, then you can use Classname.variableName to refer to it. In this case, that means saying C.q This only applies if they are in the same package, which in your case, they are. If they were in a different package, you could say packageName.Classname.Variablename

Member Avatar for BestJewSinceJC
0
104
Member Avatar for dougdudley11

If you're only allowed to use the methods defined in the MyArrayList class, then that depends entirely on what methods are in that class. I'm assuming it has a push() and pop() method, so you can "fake" the peek method by pop()ing something off, saving it into a variable, and …

Member Avatar for dougdudley11
0
129
Member Avatar for lucky200830

Correct me if I'm wrong, but it seems like you just posted an entire assignment, but didn't give any insight on how you've been trying to solve the problem - or even [I]what[/I] the problem is. So we can only assume that you didn't actually attempt the assignment. I'd recommend …

Member Avatar for stultuske
0
108
Member Avatar for BestJewSinceJC

All I can think is that there's something fundamentally wrong with how I programmed my GUIs. I have a program that initially displays a GUI which has 6 buttons. Each of these buttons, when clicked, displays a GUI. One of these GUIs in particular is a JTable of "Teams". Each …

Member Avatar for BestJewSinceJC
0
774
Member Avatar for BestJewSinceJC

Ok so lets say I have any GUI that needs its contents changed while it is running, so that it will re-display the new contents. An example would be a JTable that just lists things from an ArrayList. So if I had an ArrayList<GroceryList> my JTable might have Cheese Crackers …

Member Avatar for sanaulla123
0
7K
Member Avatar for cescbayo

Errors - Syntax/compiler errors, Runtime errors, Logic errors There you go. Now you can look them up and learn about them on your own.

Member Avatar for stultuske
0
118
Member Avatar for meteoroidkim

if you register your JButtons like this buttonName.addActionListener(this); then they will fire an event when they are clicked. Also, you will need for your class to implement ActionListener. In the method actionPerfmored, do something likr Object source = e.getSource(); // where e is the ActionEvent object being passed in. And …

Member Avatar for stultuske
-1
118
Member Avatar for ravikiran032

Your question is very confusing. Here is an example of how to set up a Socket, which is one end of a connection/pipeline to send stuff back and forth, basically. If you want the client to be on your own computer, then it would be 'localhost'. Otherwise, the String hostname …

Member Avatar for ravikiran032
0
127
Member Avatar for W@n

Also, I could be wrong, but it seems like you never set duplicate back to false. You will need to do that, otherwise once it is set to true, everything in your file will be treated like it is a duplicate.

Member Avatar for BestJewSinceJC
0
698

The End.