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
Describe, in general, how java garbage collector works?

require assistance in Java / Grails support We have a project which requires continuous maintenance / support and occasional feature development. Its running on Java 1.7 / Grail

Write a program called Power that displays the positive powers of 2. When the user enters the exponent at a prompt, the program displays 2 to that power. The program halts when the

I have a project due tonight and I need help setting up the project I know what I need to put in the class but not sure how to set it up properly

What are Commonsense Guidelines to prevent viruses? Discuss about Antivirus as well. Commonsense Guidelines to avoid viruses are as follows: 1. Do not open attachment of unwant

In JSP page give the code as given below: enctype="multipart/form-data" name="fileForm" scope="session">     Please select file here that you would like to upload:

I''m having trouble with creating a nested for loop to create a table that displays every number divisible by two within the given value. For example, if the number is 8 then there

I have JavaScript work Project Description: I need an annonation type tool added It should be incredible simple for a good js coder. But there will be a custom design and

1. Go to www.bytesizebook.com 2. Follow the first link: Guide to Web Development with Java 3. Click on Examples tab 4. Go down to Chapter 4 to find all jar folders, packages, class

1) Central museum is one of the famous tourist places in london. They ask comments from every customer visiting them.  For that, they maintained one register to store visitor;s com