Question: Write a Java code main that outputs the following: //Input (The input are inputted as a text: ( ( 1 + 2 ) - (
Write a Java code main that outputs the following:
//Input (The input are inputted as a text:
( ( 1 + 2 ) - ( ( 3 - 4 ) + ( 7 - 2 ) ) ) ( ( 1 + 2 ) - ( 3 - 4 ) ) ( ( ( 1 + 2 ) - 3 ) - 4 ) ( ( 1 + ( 2 - 3 ) - 4 ) ) ( 1 + ( 2 - ( 3 - 4 ) ) )
//output:
Expression is: ( ( 1 + 2 ) - ( ( 3 - 4 ) + ( 7 - 2 ) ) ) Postfix is 1 2 + 3 4 - 7 2 - + - Value is -1.0 Expression is: ( ( 1 + 2 ) - ( 3 - 4 ) ) Postfix is 1 2 + 3 4 - - Value is 4.0 Expression is: ( ( ( 1 + 2 ) - 3 ) - 4 ) Postfix is 1 2 + 3 - 4 - Value is -4.0 Expression is: ( ( 1 + ( 2 - 3 ) - 4 ) ) Postfix is 1 2 3 - 4 - + Value is -4.0 Expression is: ( 1 + ( 2 - ( 3 - 4 ) ) ) Postfix is 1 2 3 4 - - + Value is 4.0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
