Hi
i write a calculator ,This calculator get an arithmetic expression written in infix notation , then change it to postfix notation , then finds the value of postfix notation .
i have a problem , this program only work for one digit numbers :(
please help me to slove this problem
mahdi68
-4
Junior Poster in Training
Recommended Answers
Jump to PostVery bad style of programming and it's difficult to read your code.
Try to use stringtokenizer to parse the string, try to avoid unnecessary variable creation within a loop, try to see what variable are being created and destroyed.
After trying above, paste your code here, I'll help to solve …
Jump to PostI question the wisdom of this function specification:
String toPostfix(String Q)
Suppose Q = "12+34". What should the return value be?
"1234+" ?
Does that represent "1+234"? "12+34"? "123+4"?
All three give different answers.
All 7 Replies
NeoKyrgyz
28
Light Poster
mahdi68
-4
Junior Poster in Training
mahdi68
-4
Junior Poster in Training
VernonDozier
2,218
Posting Expert
Featured Poster
mahdi68
-4
Junior Poster in Training
VernonDozier
2,218
Posting Expert
Featured Poster
NeoKyrgyz
28
Light Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.