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
You can declare a variable by the var statement such as: var strname = some value You can also declare a variable with simply assigning a value to the variable. Although, if

Explain System Colors in java 1.1? In Java 1.1, the java.awt.SystemColor class is a subclass of java.awt.Color that gives color constants in which match native component colors

Write a program of student Using a Class Objects of a class are always created on heap using "new" operator followed by constructor Student s = new Student ( ); // no po

I have to Create a program that determine the shipping cost for an order based on he following chart: From To Price $0.00 $19.99 $2.95 $20.00 $49.99 $3.95

Your task for this assignment is to define multiple classes via inheritance. Your classes should implement various "snacks" including "M&Ms", "Popcorn", etc. To begin, create an a

What are the kinds of computer network according to the distance among nodes? The kinds of computer network according to the distance among nodes are: 1. LAN 2. WAN

Need Basic IDE with Plug-ins Project Description: I am seeking someone to create me a Basic IDE that is able to install custom created plug-ins using Java. What I need you

In this assignment I would like to have java code that would have either JFrame or something similar with multiple buttons like "BaseCase", "CoalLosses", "Demand", "NoCT,nuclear",

Need iOS native App Developer Project Description: I want someone to help me prepare a simple inventory system. I am not a programmer trying to learn as i go. Skills re

Task Your task is  to  write  a  Java  program  that  allows  users  to  play  the  game  of  Brickles. (note:  it  is  up  to  you  whether  to  use the  skeleton).  The prog