Create a separate class for your stack

Assignment Help JAVA Programming
Reference no: EM131145363

Write a java program for the following, must be two seperate methods(main and the stack class using generics).

The purpose of the stack is to check an expression involving parentheses, braces, & brackets and determine whether they are balanced

Create a separate class for your stack and implement three stack related methods (push(), pop(), and peek() only) in it.

YOU ARE NOT ALLOWED TO USE STACK CLASS FROM JAVA API.

You need to build your own stack class. The class should be reusable, that is, do not make it type specific. Use of Generic could be helpful. You can use this stack class in future to solve stack-related problems involving any data type.

Safely assign relatively large size (may be 1000) for the stack. Once the stack class is built use the class to solve the problem mentioned above. This should be a separate .java file containing the main() method.

The main() method is responsible to capture the input (file name with .java extension), parse it, use the stack (as defined in the other file), and then produce the output displaying a message showing whether the expression is balanced (parentheses, braces, and brackets) or not.

Reference no: EM131145363

Questions Cloud

How many months of living expenses does the article : Estimate how much you should set aside based upon your current situation. Are you closer to Cliff's scenario or to Prudence's?
Write a pseudo-code program : Create 10 child processes and each child process will in turn create a grandchild process.
Explain customer defined value-value analysis and retention : Explain customer defined value, value analysis and retention. Discuss product innovation models for customer retention. Discuss employee empowerment. Discuss leadership for quality. How to lead for a better quality change?
What is your projected sales volume by month : Sales Revenue Forecast: What is your projected sales volume by month for the first year? Expense Forecast: What is your total expected marketing costs? Break your costs down by each marketing, promotion, and action program strategy that you listed ..
Create a separate class for your stack : The purpose of the stack is to check an expression involving parentheses, braces, & brackets and determine whether they are balanced
How an individual or firm acting out of self interest : Create an original example to demonstrate how an individual or firm acting out of self-interest (seeking profits by offering goods or services in economic markets) must benefit consumers – even if they do not care about them - more than the competiti..
Was there anything unethical about the presidents actions : Riverside Automotive Corp. is a medium-sized wholesaler of automotive parts. It has 10 stockholders who have been paid a total of $1 million in cash dividends for 8 consecutive years.
Describe how socioeconomic status affects health care : Socioeconomic status influences health and drives diversity in the context of health disparities. Based on readings provided, describe how socioeconomic status affects health care. Can diversity in the health care workforce promote better health c..
Importance of quality partnering and strategic alliances : Discuss the importance of quality partnering and strategic alliances. Discuss the various forms of quality partnering and strategic alliances. Discuss the importance of quality culture

Reviews

Write a Review

JAVA Programming Questions & Answers

  Question superclass and provide a different implementa

Add a method addText to the Question superclass and provide a different implementa- tion of ChoiceQuestion that calls addText rather than storing an array list of choices.

  What is the value of r

TOY  Consider what happens when the following TOY program is executed by pressing RUN with the program counter set to 10: 10: 8110 R[1] A. What is the value of R[1] after the instruction at location 10 completes? B. What is the value of R[2] after ..

  Write a program that starts a player off with a bank of $15

Write a program that starts a player off with a bank of $15.00.

  What significant justification is there for the -> operator

Dynamic type binding is closely related to implicit heap-dynamic variables. Explain this relationship. Keep your answer to 1 paragraph or less.

  Create a java class named headphones

Create a Java class named HeadPhones to represent a headphone set. The class contains- A private String data field named manufacturer that specifies the name of· A private boolean data field named pluggedIn that specifies if the headphone is plugge..

  Create an employee class.

Create an Employee class. Items to include as data members are employee number, name, date of hire, job description, department, and monthly salary.

  What could you do to kill more mutants

What are the implications related to suite of unit test cases when some mutants are not killed and What could you do to kill more mutants?

  Develp a simple model of an object-oriented system

you are going to develp a simple model of an object-oriented system. this model should be able to provide all the working examples of inheritance, encapsulation, and polymorphism through the use of class,. methods, and objects

  Delete a random element from an arraylist

Elements in an ArrayList and picking one at random to remove. Unfortunately, this slow, since deleting a random element from an ArrayList is slow because of all the shifting. For this question, you should modify the poll()method so that it runs in..

  Write the definitions of the methods to implement operations

Calculate and return the day by adding certain days to the current day. For example, if the current day is Monday and we add four days, the day to be returned is Friday. Similarly, if today is Tuesday and we add 13 days, the day to be returned i..

  Describe different professional levels in this discipline

What is Anesthesiology and critical care medicine describe the specific discipline, what is their focus (i.e., emergency medicine, education and prevention, psychiatric treatment etc.) Describe the different professional levels in this discipline

  Modify the homestead furniture store application

Design an application for the homestead furniture store that gets sales transaction data including an account number customer name and purchase price.

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