Data structure of different delimiters, JAVA Programming

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.

Posted Date: 3/1/2013 8:07:25 AM | Location : United States







Related Discussions:- Data structure of different delimiters, Assignment Help, Ask Question on Data structure of different delimiters, Get Answer, Expert's Help, Data structure of different delimiters Discussions

Write discussion on Data structure of different delimiters
Your posts are moderated
Related Questions
Explain the library java.lang.Math ? The Java class library is huge. We will not cover it all presently. In fact, the remaining eight classes will focus mostly on the class lib

In RPC the method invoker waits for the method to finish implementation and return the control back to the invoker. Therefore it is completely synchronous in nature. Whereas in JMS

Explain what is constructors ? It is frequent the case in which overloaded techniques are essentially the similar except that one supplies default values for a few of the argum

Illustrate the parser method The below table summarizes the parser methods available to a java programmer.

public class ConcatDemo { public static void main(String[] args) { String animal1 = "quick brown fox"; String animal2 = "lazy dog"; String article = "the";

code for error correction and detection using even odd parity

EJB 2.x is broadly adopted server side component architecture for J2EE. 1. EJB is a remote, distributed multi-tier system and allows protocols like IIOP, JRMP, and HTTP etc.

1. Unit tests :There are two popular processes to testing server-side classes: mock objects, which test classes by checking the server container, and in-container testing, which

The problem statement is pretty simple. We need a software implementation of a Point of Sale terminal at a typical store. The users of the system are the cashiers sitting at the sa

Interface to calculate carbon foot print