Question: Create a java program using the following requirements Using the pseudocode algorithm below, write a method that takes a String parameter and determines whether the
Create a java program using the following requirements

Using the pseudocode algorithm below, write a method that takes a String parameter and determines whether the enclosing punctuations are correctly nested. It will return true if they are, and false otherwise. You must account for parentheses, square brackets, and curly braces. Create an empty stack for characters For each character in the string if the character is '(' or '[' or '{' push it onto the stack else if the character is ')' or ']' or '}' if the stack is empty return false else pop a character from the stack if the popped character is not the left version of the character being considered return false endif endif endfor If the stack is not empty return false return true endif Also, write a main method that prompts the user for a string and then calls and prints the return value of the above method
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
