Write a driver program teststackumuc implemented as a


Part 1

Design, implement and test a generic stack class StackUMUC (this name is chosen as to avoid confusion with similar classes defined in JDK). Use an array or an ArrayList as support data structure.

For StackUMUC class, implement the following methods:

StackUMUC(int) // class constructor, parameter indicates the size void push(T) T pop() T peek() booleanisEmpty() booleanisFull() String toString()

Write a driver program TestStackUMUC, implemented as a separate class, to test the class StackUMUC. Test the class for the JDK types Double and String and for the user defined type Point. The class Point represents 2D Cartesian points having x and y as instance variables, a default constructor and a constructor with arguments, and the methods getX, getY and toString.

Part 2

Use the class StackUMUC to design, implement and test a Lisp verifier program that checks the proper balance of the parenthesis in Lisp programs. As an example of List code, the program fragment below defines the function factorial.

(defun factorial (n) (if (= n 0) 1 (* n (factorial (- n 1)))))

The Lisp verifier program will be implemented using a Java Swing GUI. The GUI should define an input text area where the user should enter the Lisp program, an output text area where the program will show the results and a button Verify to start the verification process. In the output text area the program will display a message indicating whether the parenthesis of the verified program are well balanced or not as well as the number of open parenthesis and the number of closed parenthesis. If the parentheses are not well balanced the program will give appropriate indications helping the user to locate and fix the error.

The programs should compile without errors.

Note. Lisp is a functional programming language, which uses fully parenthesized Polish prefix notation. More about Lisp programming language you can find here: https://en.wikipedia.org/wiki/Lisp_(programming_language)

Other Lisp functions that can be used for testing your program can be found here: https://www.cis.upenn.edu/~matuszek/LispText/lisp-examples.html

2. Submission requirements

Submit the following before the due date listed in the Calendar:

1. All Java source files. The source code should use Java code conventions and appropriate code layout (white space management and indents) and comments.

2. The solution description document _P1 (.pdf or .doc / .docx) containing: (2.1) assumptions, main design decisions, error handling; (2.2) test cases and two relevant screenshots; (2.3) lessons learned and (2.4) possible improvements. The size of the document file (including the screenshots) should be of 3 pages, single spaced, font size 12.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Write a driver program teststackumuc implemented as a
Reference No:- TGS01418358

Now Priced at $120 (50% Discount)

Recommended (96%)

Rated (4.8/5)