Hi yeah I forgot to change it to 10.
I am now having the code give me the same answer for each equation the out put is:
49+62*61-36
15.666666666666668
4/64
15.666666666666668
Type: Posts; User: why_always_me
Hi yeah I forgot to change it to 10.
I am now having the code give me the same answer for each equation the out put is:
49+62*61-36
15.666666666666668
4/64
15.666666666666668
Hi I managed to get it working for one equation by moving the end bracket of the while statement to line 101.
I am now getting the following error:
Exception in thread "main"...
Hi
I have tried that and I am unable to find the reason for it just using the last token.
Basically what happens is when I call the RPNtoDouble function I was printing the token that was being...
sorry I added the description so it was clear what they should be.
at the minute the input file contains only:
49+62*61-36
and the output should be
49+62*61-36
[49+62*61-36]
3795
Hi the program currently outputs:
49+62*61-36
[36]
36.0
whereas the program should be giving me
equation read in
49+62*61-36
Hi Everyone
My code is an implementation of the shunting yard algorithm - Shunting-yard algorithm - Wikipedia, the free encyclopedia to convert infix expressions to postfix. I then try and solve...
Hi Guys my new thinking is :
List class
Node class
Shunting yard class
Main class
Main includes the reverse Polich notation, filereader and tokenizer.
My question now is how would i...
so my thinking now is to have the following classes:
stack class
main - filereading, dealing with the numbers+operands
shunting yard class
Is this an acceptable sort of hierarchy?
thanks
Hi thanks for the help.
How would I implement my own stack without using the java utils?
also what sort of hierarchy should i use? I was thinking maybe a filereader class and then one to deal...
am basically attempting to create a calculator using a class hierarchy - the basic function will be:
Convert the String representation into a list of Tokens
Convert the List of Tokens into Polish...
Hi so i tried using if statements to set my rNum variable and it never changes from 0? any ideas?
public void readStartFile(String fileName){
int rNum=0;
int cNum=0;
...
Hi I have now found out how to use the split method correctly. here is my piece of code used for an example as you suggested.
public class SplitExample{
public static void main(String...
managed to get jdk 7 working now. still slightly confused by the split() method though. is there any easier way of detecting the R,C and colour?
thanks
sorry i am not too sure :(. Can not get any code to compile on my laptop at the minute after trying to install jdk 7. no matter what program i try and run i just get the error could not find or load...
i removed the bottom line strLine.removeCharAt(strLine[0]);
and it compiles fine.
ok so it should be something like
while ((strLine = br.readLine()) != null) {
strLine.split(" ");
strLine.removeCharAt(strLine[0]);
}
ok thanks. so would that mean i would do something like
while ((strLine = br.readLine()) != null) {
strLine.split(" ");
strLine = strLine.substring(0,...
Hi I will be determining the correct square by trying to parse the row and column info from the file as well as the colour and then using
buttons[row][col].setBackground(colour)
where row...
Hi I have managed to get the colouring in part to work :) but i am now confused on how to do the file reading. below is the new code that colours squares and SHOULD fill some in from the start. the...
Hi ok thanks for that. I have now managed to get the squares to change colour. How will i now make them go back to default if they are clicked and they have been coloured in? thanks
here is the...
Hi this is my first post here.
basically i want a programme to do teh following:
1)create a 6x6 grid.
2)ask the user to choose from 6 colours to fill a square
3)test to see if one row or...