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

  Create a java class called month

Create a program/project called [YourName]-(replace [YourName] with your actual name) in the same project as the Month.java, Create three objects: Month1 one using the first constructor (with no arguments) and Month2 using the second constructor wi..

  Compute the daily wage of an employee

Write a JAVA program that will input Employee Name, Rate per hour, No. of hours worked and will compute the daily wage of an employee. If the number of hours worked exceeds eight hours add 30% to each excess hours as overtime rate.

  Socket programming in java tcpgoal in this project we will

socket programming in java tcpgoal in this project we will develop a web server in two steps. in the end you will have

  Write the string copy and string concatenation functions

Write the string copy and string concatenation functions and first version should use array subscripting, and the second version should use pointer arithmetic.

  Write a monitor to control the thirsty people and server

The thirsty person who can make a drink from those two items will pick them up and drink a glass of ice water. Write a monitor to control the thirsty people and the server.

  Write an application that displays the factorial

Write an application that displays the factorial for every integer value from 1 to 10. A factorial of a number is the product of that number multiplied by each positive integer lower than it.

  What is the greatest common divisor

What is the greatest common divisor of the Fibonacci numbers f100 and f101 by Euclid algorithm.

  Need to create a pyramid with first name robert

Need to create a pyramid with first name Robert inside of a method named namePyramid and the print out to the console should look like this: Disregard the periods: I needed them to move the pyramid over

  Compute and display the monthly payment

Compute and display the monthly payment -  programming problem can be solved by a program that performs three basic tasks-Input Data, Process Data, and Output Results.

  How is the location of the click point determined

When a mouse event is generated how is the location of the click point determined?

  Uml exercise

UML Exercise: Automated Teller Machine (ATM),   1. To allow authorized card holders to make transactions,   Brief Summary of Requirements:

  Make a fourth button called special

Make a fourth button called "special" that does something else notdescribed in the assignment, such as change the background color.

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