im trying to convert this snipet of of pseudo code in java code.
String operand = "" get char c from current position in string (pos) if c isn't (, ), +,-,*,/, or ^ then check if c is a letter if c is a letter, operand+=c increment current position get char c from current position in string while c is a letter or a digit operand+=c increment current position get char c from current position in string end while operand now contains the characters which make up its name
here what i got so far
//method to check multi-variable characters
public String getMultiVariables(char c){
String operand = "";
int pos=0;
if(c != '*' || c!='/'||c!='+' ||c!='-'||c!='('||c!=')'||c!='^')
if(Character.isLetter(c))
operand +=c;
pos++;
while(Character.isLetterOrDigit(c))
{
operand +=c;
pos++;
}
return "unknown type";
}
not working thou close
any help at all will be good
thanx
This post has been edited by Beginner2009: 14 April 2009 - 11:22 AM

New Topic/Question
Reply




MultiQuote




|