Starting from:

$19.99

CS2050 Activity 8 Solution

Write a program that reads an arithmetic expression (as a String) from the standard input and then checks if the parentheses in the expression are balanced (i.e., for every opening parenthesis there should be another one closing). Use the dynamic stack implementation discussed in class and available online in our GitHub repository.
Test your code using the following expressions:
( 5 - 2 ) * 3 / ( 8 + 5 ) ( 5 - 2 ) * 3 / ) 8 + 5 ( 3 + 2 - 4 ( ( ( ( ( 1 + 1 ) - 1 ) - 1 ) - 1 ) - 1 ) ( ( 4 + 2 ) - ( 7 - 3 ) )

More products