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

  Developing a java application

You have been requested to develop a Java application for the local library as part of an upgrade initiative. As in all libraries, this is a place where one can check out books

  How many tickets for each class of seats were sold

Prepare a program that asks how many tickets for each class of seats were sold, then shows the amount of income generated from ticket sales.

  Calculate the area of the circle

Circle Area- Write an application that prompts the user for the radius of a circle and uses a method called circleArea to calculate the area of the circle

  The reference to the abstract class

Explain what happens when the reference to the abstract class X is used to execute method M1( ). X obj = new Y( ); obj.M1( );

  Write a jsf application that reports the values

Write a JSF application that reports the values of the following system properties of the web server

  Determine the charge for each customer

The program should display the charge for the current customer and should calculate and display the running total of yesterday's receipts. The program should use the method calculate-Charges to determine the charge for each customer.

  Develop a java program given the width, length and depth

Write the source code for each class in a separate file which must have the same name as the class name together with the extension .java. Remember also that by convention, class names commence with a capital letter.

  Write a method called alldigitsodds that returns whether

write a method called alldigitsodds that returns whether every digit of a positive integer is odd. return true if the

  Compute the fifties and the remaining amount

Prompt the user for a string input value for the amount in dollars and store it in a variable named input and convert the string to an integer and store it in the variable named amount.

  Write the logical expression in postfix notation.

Given symbols p, q, r, and s for propositions. Draw the binary tree representation of the logical expression ((p || r) && ! p ) || s) && (q || r). Write the logical expression in postfix notation.

  Balancing binary search trees

Balancing Binary Search Trees,  Consider the file BST.java (a link to this file is provided below for downloading purposes) which defines a generic Binary Search Tree class.

  Java programming-gamesystem

JTabbed Panes for GUI Components Part 2: --- Create a JFrame program with a JTabbed pane on it with two panels that mimics a control box for a game system.

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