Describe an algorithm and write a program that asks the user to enter a series of parentheses and/or braces and then indicateThe program must accept characters other than (, ),,but ignores them in the processing (i.e., they are not pushed onto the st

Describe an algorithm and write a program that asks the user to enter a series of parentheses and/or braces and then indicate whether or not they are properly nested: Enter parentheses and/or braces: COTHO) Parentheses are nested properly Enter parentheses and/or braces:COO) Parentheses are not nested properly The program stores these braces on a stack that has a maximum size/capacity of 10 items. Hint: Given that a stack is last in first out data structure, it can help you check if the parentheses are balanced or not. Remember that all parentheses need to be balanced. This means that if your reach the end of the user input (i.e., a newline), you should check that the stack is empty. Otherwise, the paranetheses are not fully matched. Remember to also check if the stack has reached maximum capacity before attempting to push any new items on it. If the stack has already reached its maximum capacity, and the program tries to push additional items, the program should print the message Stack overflow and terminate immediately. The program must accept characters other than (, ),,but ignores them in the processing (i.e., they are not pushed onto the stack and it does not attempt to match them to existing items on the stack). Before starting to implement your program, write out the algorithm you will be using (in pseudocode) in a file called algorithm.txt . Underneath the algorithm pseudocode, describe the invariants of your main loop, making sure to account for all potential types of input. A loop invariant is a set of statements or assertions which hold true at the beginning and end of any iteration of the loop. For example, for the given simple pseudocode i Show transcribed image text