Docsity

Programming Assignment 5: Stack Practice and Symbol Balancing - Prof. Mary Califf, Assignments of Information Technology

Toggle sidebar
bg1
ITK 179
Fall, 2005
Califf
Programming Assignment 5
Stack Practice
Due Date: Friday, October 21, 2005 by the beginning of class
Progress Due Date: Friday, October 14, 2005 by the beginning of class. Submit your stack
class, along with a JUnit test of the class’s operations, to WebCT. Also turn in pseudocode for
the main logic of the program as a text document.
Develop a stack class of your own using a linked list representation and string data and use it in a
program that checks Java programs for the balancing symbols (/* */, ( ), [ ], and { }). The
program should read in a program and output one of four messages.
Case 1: Symbol1 does not match symbol2.
Example: “(” does not match “*/”.
Case 2: End of program reached with unmatched symbol.
Example: End of program reached with unmatched “{”.
Case 3: Symbol1 has no matching opening symbol.
Example: “)” has no matching opening symbol.
Case 4: All symbols correctly balanced.
In cases 1 and 3, the program should also report the line on which the error was discovered.
Important note: you do not have to worry about ignoring symbols inside comments or strings.
Assume that all symbols in the file must match up properly.
Use good object-oriented design. Allow the user to check as many files as he/she wishes.
Use a GUI. It doesn’t have to be fancy, but it should be usable.
Your progress piece is due by class time on Friday, October 14. Zip the .java files and the .txt
file into a file named Prog5Progress.zip, and submit them using WebCT. This is worth up to 10
programming points.
Your final program is due by class time on Friday, October 21. Zip only the .java files in your
project into a file named Prog5.zip, and submit them using WebCT. The working program is
worth up to 40 programming points.
Make sure your program is well-commented..
Extra credit 1 (up to 5 points): Check for balancing quotation marks.
Extra credit 2 (up to another 5 points): Ignore symbols inside comments or strings. Must
complete extra credit option 1 first.
Note: extra credit only applies to A or B programs.
pf2

Partial preview of the text

Download Programming Assignment 5: Stack Practice and Symbol Balancing - Prof. Mary Califf and more Assignments Information Technology in PDF only on Docsity!

ITK 179 Fall, 2005 Califf

Programming Assignment 5

Stack Practice

Due Date: Friday, October 21, 2005 by the beginning of class Progress Due Date: Friday, October 14, 2005 by the beginning of class. Submit your stack class, along with a JUnit test of the class’s operations, to WebCT. Also turn in pseudocode for the main logic of the program as a text document. Develop a stack class of your own using a linked list representation and string data and use it in a program that checks Java programs for the balancing symbols (/* /, ( ), [ ], and { }). The program should read in a program and output one of four messages. Case 1: Symbol1 does not match symbol. Example: “(” does not match “/”. Case 2: End of program reached with unmatched symbol. Example: End of program reached with unmatched “{”. Case 3: Symbol1 has no matching opening symbol. Example: “)” has no matching opening symbol. Case 4: All symbols correctly balanced. In cases 1 and 3, the program should also report the line on which the error was discovered. Important note: you do not have to worry about ignoring symbols inside comments or strings. Assume that all symbols in the file must match up properly. Use good object-oriented design. Allow the user to check as many files as he/she wishes. Use a GUI. It doesn’t have to be fancy, but it should be usable. Your progress piece is due by class time on Friday, October 14. Zip the .java files and the .txt file into a file named Prog5Progress.zip, and submit them using WebCT. This is worth up to 10 programming points. Your final program is due by class time on Friday, October 21. Zip only the .java files in your project into a file named Prog5.zip, and submit them using WebCT. The working program is worth up to 40 programming points. Make sure your program is well-commented.. Extra credit 1 (up to 5 points): Check for balancing quotation marks. Extra credit 2 (up to another 5 points): Ignore symbols inside comments or strings. Must complete extra credit option 1 first. Note: extra credit only applies to A or B programs.

Grading Standards A perfect program will: Run correctly, meeting all specifications from the assignment Will show all output in the proper format (neatly spaced, money with 2 decimals, etc) Use good structured and object-oriented programming Handle files correctly (opening, closing, correct reading loops, etc.) Be correctly formatted with clear indentation Be well commented Be submitted correctly An ‘A’ program: Will run correctly, meeting all specifications from the assignment Will show all output in the proper format (neatly spaced, money with 2 decimals, etc) Will use good structured and object-oriented programming Will handle files correctly (opening, closing, correct reading loops, etc.) May have no more than two minor errors in design, format, or submission A ‘B’ program: Will run correctly on any sample data Will use good structured and object-oriented programming Will handle files correctly (opening, closing, correct reading loops, etc.) May have minor errors in execution on alternate data or more than 2 minor errors in design, format, and/or submission or a single execution error on alternate data A ‘C’ program: Will compile and run May have multiple minor errors or errors in multiple areas or up to 2 major errors A ‘D’ program Will compile and run Has serious problems in execution and/or design An ‘F’ program Does not compile or does not run or seriously lacks design materials or substantially fails to follow the assignment guidelines or has a number of errors of different kinds