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 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.
Jump to PostDon't have the function return a String. It needs to split apart the equation into numbers and operators. Numbers are not stored as characters or strings. They should be stored as numbers (integers or doubles). Operators are stored as characters. Looks like you are trying to set up a stack, …
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.