Im trying to do this but I am a still having problems because I still have strings. I need the infix expression to be in a character array to pass to my methods and the numbers to be integers to...
Type: Posts; User: KristopherP
Im trying to do this but I am a still having problems because I still have strings. I need the infix expression to be in a character array to pass to my methods and the numbers to be integers to...
Im not trying to parse it into an int. The code is wrong. I am asking what I need to do to read the first line which will be an expression.
Then read the second line which are numbers and parse...
I understand this. I can not figure out how to go through the file.
the way I wrote the while loop
test = st.nextToken();
grabs the next token which is A
numbers =...
I am having trouble with StringTokenizer. I have an input file that has an infix expressions followed by
a set of numbers which are the values for the variables
A + B * C
1 3 5 2 2 2
The...
Sorry that was just meant to imply that I was printing index 0 of the array's. When I went back to check the code I seen that I was trying to print a [] array when they were [][]. I made the change...
I am trying to copy the contents of a file into an array.
The contents of the file is
John X Doe 4.0 6 8.2 9
I had some typos and it would not read the names. Now I got the names storing to an...
Instructor gave us an assignment to do which was the final for her CS1 class. I did not have this instructor and did not learn StringTokenizer or String.split() in my CS1 class. StringTokenizer...
I am trying to copy the contents of a file into an array.
The contents of the file is
John X Doe 4.0 6 8.2 9
The code the instructor wrote on the board. I inputted it and when trying to run I...
Thanks for the input and links but, I am not getting it. I got my program to perform by using the locations in the arrayList since I know where each object is. I would still like to create a method...
I am not sure I do not know if it is an object or string
It is , I need to return the variable from Color c Im just not sure how since Im confused on the method header and code. The text book...
Thanks but, the problem is I do not know how to do a getColor() method. I do not know what the return type should be or what code I would use to get the color from one of my objects
I believe my previous post was in the wrong section. I need a way to check the color of objects in an arrayList. I included my Block class and what I have so far. I am not sure what I need to...
My main question is do I need to create a getColor method or can I use the getColor that is already available as part of Color.
If I can use the getColor already available that is getColor(String...
I am having trouble with a simple game. I have a game made with Blocks. The blocks are made as
Block(double x1Lc, double y1Lc, double w, double h, Color c)
They are then added to an ArrayList. ...
I did the nested if and it worked. Thanks for your help
I tried your suggestion with
if( size > 0)
{
answer = input.charAt(0);
}
When I get to the next part it tells me answer is not initialized
So if I added something like this to check the length of the string, where would I need to add it to prevent the crash? Would I had a comparison to my if statement?
int size;
size =...
I am having trouble with my program. I finished it but, I can not get the begging to cooperate. I need to take a users input if they would like to play a game. I have to use the charAt method to...