Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

Help with this C++ Data Structures Project

Using good OOP, write a C++ program that will determine if a string has balanced delimiters.  

Be sure to use good programming methodology and keep your project modular.

Use private member functions and variables.
Use public member functions for a constructor (where appropriate) and a driver method only.

These specifications do not give a list of method names to be used. It is assumed the program will use several methods doing one task each.

NOTE: Any submission that uses global variables or does not use a class and object appropriately will result in a project grade of 0.

A string may use more than one type of delimiter to bracket information into blocks. For example, a string may use braces { }, parentheses ( ), and brackets [ ] as delimiters.
A string is properly delimited if each right delimiter is matched with a preceding left delimiter of the same type in such a way that either the resulting blocks of information are disjoint, or one of them is completely nested within the other.

Write a program that uses a single stack to check whether a string containing braces, parentheses, and brackets is properly delimited.
Use input file string.txt as input to test your program.
Each line in the input file is a string. If the string is properly delimited, display a message stating so. If it is not properly delimited, display a message stating so.

For example, if the input file contains the following 3 lines of strings:

if (a[i] > b[i])
while (c[index] < 0) { a++; b--; c[index++];}
for ({int i = 0; num[i }];

would display the following output:

Processing input file...

String:
1. is properly delimited
2. is properly delimited
3. is not properly delimited

End of file.

Another input file Example called string.txt:

if (denominator[x] == 0) cout << "ERROR: {Cannot divide by zero.\n}";
while (number[0] > number[1] ) { ((number[i]++; } num[i+1]--; ))
for ((int j = 0; object[j + k]); j++)
do { (x = x - 7;) { ((y = number + x) / 4) } }

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education