+ 2

Hey! Please help me in designing a code for the following question in java i would like to understand how to make it

Also please give the answer step after step so that i can understand it easily as i am getting too many bugs in my program https://www.sololearn.com/learn/704/?ref=app

5th Apr 2019, 9:37 AM
Rajb957
Rajb957 - avatar
6 Réponses
+ 2
Before you start adding those features, the code that you started from has a known issue that needs to be addressed. Precedence is handled incorrectly. In the code every operator is given a unique precedence that is either greater than or lesser than another operator. In mathematics, some operators have equal precedence. That is, Addition and Subtraction have the same precedence. When two operators have the same precedence, the Associativity determines the order of evaluation. The Associativity of the operators your code already supports is from left to right. This means that when two operators have the same precedence, evaluate the leftmost operator first. Once this task is finished, you'll be able to add the features that you want.
6th Apr 2019, 11:15 AM
Aaron Becker
Aaron Becker - avatar
+ 1
Raj Bunsha Make your code public and as it to this post. Maybe I can help if you have a specific problem or question.
5th Apr 2019, 1:17 PM
Aaron Becker
Aaron Becker - avatar
+ 1
Ok thanks Aaron Becker i will edit my code and show you the next please verify it i will show it soon
6th Apr 2019, 11:30 AM
Rajb957
Rajb957 - avatar
+ 1
Raj Bunsha You're welcome, I look forward to the update.
6th Apr 2019, 11:31 AM
Aaron Becker
Aaron Becker - avatar
0
Hey here's my code it is similar like that of shanky sharma but somewhat edited i want to make it multiply with brackets but i think my algorithm is not correct and i also want to keep ^ sign also there are problems like https://code.sololearn.com/cTxHUAasNx8P/?ref=app
6th Apr 2019, 9:03 AM
Rajb957
Rajb957 - avatar
0
Ok sure
6th Apr 2019, 11:31 AM
Rajb957
Rajb957 - avatar