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

  Create pipe-and-filter network that will read data stream

Create a pipe-and-filter network that will read the data stream in FlightData.dat file, convert the temperature measurements from Fahrenheit to Celsius, and convert altitude from feet to meters - How would this impact the key quality attributes of ..

  Java program on eclipse

Using a while( true ) loop,and using the upper case alphabeth from Z to A,print the lower case alphabeth and its corresponding ascii values.You must terminate/exit/break this loop once you process the last letter (A).

  How to write and incorporate string

How to write and incorporate string - custom function

  Construct a fileinputstream with the file name

Write a program that will search a text file of strings representing numbers of type int and will write the largest and the smallest numbers to the screen. The file contains nothing but strings representing numbers of type int one per line. Your s..

  Goals of managing health information

Describe how you would explain the purpose and goals of managing health information to a new health care employee.

  A uml activity diagram that illustrates how program works

Create a UML activity diagram that illustrates how your program works. Your diagram must include all the data items in your program.

  Calculates the cutoff frequency in a simple rc circuit

Write a simple Java application which calculates the cutoff frequency in a simple RC circuit.

  Implement a class icecreamcone

Implement a class IceCreamCone with methods getSurfaceArea() and getVolumn(). In the constructor, supply the height and radius of the cone. Be careful when looking up the formula for the surface area

  Define an applet and describe the usefulness of an applet

Define an Applet, and describe the usefulness of an applet. Please give a simple example

  Write a test program that creates an array

Design an interface named Colorable with a void method named howToColor(). Every class of a colorable object must implement the Colorable interface.

  Method definition to count and then return the number

Write a nested loop structure that prints out the following number series: 111 112 121 122 211 212 221 222. The innermost loop may have only one print statement and no literal string output except a space (" ").

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