Write a driver program teststackumuc

Assignment Help JAVA Programming
Reference no: EM131072560

Part 1

Design, implement and test a generic stack class StackUMUC<T> (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<T> 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<T>. 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<T> 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 <YourSecondName>_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.

Reference no: EM131072560

Questions Cloud

Identify a group of children with leukemia : We measure the standing heights of five basketball players and find that Thom is 203 cm tall; Ram is 204 cm tall; Malcolm is 201 cm tall; Joshua is 204 cm tall; and Sylvia is 202 cm tall. What kind of graph (not table) would we use to display thi..
Pair-wise fashion with respect to one performance measure : Suppose 4 scenarios were compared in a pair-wise fashion with respect to one performance measure. How many comparisons are made? If a = 0.01 is used for all comparisons, what is the upper bound on the a for all the comparisons made?
Will revenues increase or decrease in the short and long run : Will revenues increase or decrease in the short and long runs?
What is net present value of this project at discount rate : Fun Land is considering adding a miniature golf course to its facility. The course would cost $64000, would be depreciated on a straight line basis over its 4 year life, and would have a zero salvage value. The estimated income from the golfing fees ..
Write a driver program teststackumuc : 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.
What is the equation of the tangent line to the graph : MATH233 Individual Project- For your function what is the instantaneous rate of change in maximum error-free channel capacity with respect to SNR, for SNR=30? What is the equation of the tangent line to the graph of C(SNR), when SNR=30
Generate the two random number streams : a. Generate the two random number streams, corresponding to interarrival time and operation time at station A, for the first ten arriving entities in the two workstation in a series model.
The two workstation in a series model : Consider the two workstation in a series model and the last event list shown in section 5- 5. Current Simulation Time: 8.0. Next Simulation Time = Time of first event occurrence in list = 8.0
Will he allocate it to snowboarding or jazz : In the example given in Table 6.1, suppose Neal experiences a small increase in income. Will he allocate it to snowboarding or jazz?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd