Data structure of different delimiters, JAVA Programming

Assignment Help:

In this experience you will make the neophyte Java programmer happy by solving, to a limited extent, an age-old problem in programming:  mismatched delimiters.  As we all know, every left bracket needs a matching right bracket and your program will attempt to check this by prompting the user for a string containing delimiter; for example {123456. When you hit ENTER your should report back that you are missing a right delimiter. In fact, your program will check for three possible delimiters: left or right braces {}, left or right parentheses () or left and right brackets []. The error message that will be returned if there is a mismatch depends on the problem. If the right delimiter is missing you will specify "missing right delimiter"; if the left delimiter is missing you will specify what is missing: {([and where in the string the error occurs. For example, iii} should return the following error: "error} at 4". This would indicate no left delimiter. If there are no problems return nothing; simply prompt for the next string until the use hits ENTER to stop the program. Examples: {[hhhhh} would generate missing right delimiter error. However, something such as}}}}} would generate "error :} at 0", "error :} at 1", error :} at 2 ", "error :} at 3 "and "error :} 4 ".

You must use a stack data structure to help you parse the delimiter.


Related Discussions:- Data structure of different delimiters

What is the string concatenation, What is the String Concatenation + Op...

What is the String Concatenation + Operator is employed to concatenate strings - System.out.pritln ("Hello" + "World") will print Hello World on console String concatenat

Problem D., In Exercise 1 you were asked to modify the Sorts program so tha...

In Exercise 1 you were asked to modify the Sorts program so that it would output the number of swaps used by a sorting method. It is a little more difficult to have the program als

Describe the socket and inter process communication in java?, A   socket   ...

A   socket   is      interaction   channel,   which   facilitates   inter-process   communication. A socket is an endpoint for interaction. There are two types of sockets, dependin

Explain traversing through a collector using iterator, Explain traversing t...

Explain traversing through a collector using Iterator. Ans. We can access each element in Collection by using Iterators regardless of how they are organized in collector. Ite

Debugging, Debugging mode can be enabled by adding the following line of co...

Debugging mode can be enabled by adding the following line of code before creating new connections: XMPPConnection.DEBUG_ENABLED = true; When debugging mode is enabled, a

What is java rmi, Remote Method Invocation (RMI) is the process of activati...

Remote Method Invocation (RMI) is the process of activating a method on a remotely running object. RMI offers location transparency in the sense that it gives the feel that a metho

Type of messaging is given by jms, Point-to-Point : gives a traditional qu...

Point-to-Point : gives a traditional queue based mechanism where the client application forwards a message through a queue to typically one receiving client that accepts messages

Coding, code for error correction and detection using even odd parity

code for error correction and detection using even odd parity

Describe what is meant by a constructor in java, Question: (a) Describe...

Question: (a) Describe what is meant by a ‘constructor' in Java. Use a simple example to illustrate your answer. (b) Differentiate between a class method and an instance me

Combo box and Check box help, Sal?s Pizza wants to install a system to reco...

Sal?s Pizza wants to install a system to record orders for pizza and Buffalo chicken wings. When regular customers call Sal?s Pizza on the phone, they are asked their phone number.

Write Your Message!

Captcha
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