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

Distributed / Network Oriented Java is network friendly -- both in its portable, threaded nature, and since common networking operations are built-in to the Java libraries.

Write a program of else statement in java? The else statement in Java // This is the Hello program in Java class Hello { public static void main (String args[]) { if (

Differentiate between SMTP and POP3 server? SMTP (Simple Mail Transfer Protocol) is a protocol used to send and receive eMail messages over a TCP/IP network. While POP3 (Post

List down the names of two array techniques available in JavaScript. The two techniques thata rae available in java script is: 1. sort( ) [sorts elements within alphabetical

Action mapping having all the deployment information for a particular Action bean. This class is to verify where the results of the Action will be sent once its processing is done.

Question 3 Using this line: var posneg : array [1..15] of integer; Write a program that calculates the number of negative and positive numbers in the array. Users will

Im not in the line of computer science.But i would like to have some knowledge about the computer language "JAVA".I aldredy learns the computer languages "C,C++".So kindly help me

A question rising in the mind of XML/DTD designers is whether to model and encode retain information using an attribute, or alternatively, using an element. 1. Using  an  elemen

Need tomcat based iptv cms p2p , avrelay trans-coder software Project Description: Tomcat based iptv cms p2p tracker cdn included, avrelay for trans-coding h264, Skills re