This lab gives you experience developing a class with a method that uses a Stack.
Do the following activities before coming to the lab:
Download, save, and unzip the file delimiter_pairs.zip on your removable media (floppy disk, Zip disk, or memory stick), creating a new directory for this homework assignment.
Study the java.util.Stack class in the documentation on the Oracle website so that you know how to use it.
You will write a method that checks a file to determine that each opening delimiter '{', '[', and '(' is followed later in the file by the correct closing delimiter '}', ']', and ')' respectively following the Java syntax rules for proper nesting. This problem represents one portion of the design of a compiler that needs to check that all such pairs of delimiters are properly balanced and nested.
You need to design and add code to the main method of the BalanceCheck class in three places as indicated by the comments:
Depending on your choice of IDE, compile the program. Run your program on the three test files provided: TestClassBad1.txt, TestClassBad2.txt, and TestClassGood.
Answer the following questions related to what you did in this week's lab.
What results did your program provide for each of the test case files?
Study the nesting of the delimiters in each file. Did your program correctly identify the problem in the two bad files?
Note: You should work alone on the lab report.