
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) } }

Trending nowThis is a popular solution!
Step by stepSolved in 4 steps with 6 images

- Note:I asking this question again because i couldn't understand the previous answer,if you can explain more detailed or easy it would be really good for me. AssignmentWrite a program in C++ that will track certain information about the flights of aircrafts. Youwill create your program by referencing the structure given in the diagram (1)(Diagram is attached). Classdefinitions, access specifiers, data members and member functions in your program must becoherent with the diagram. Certain essential variables for operations such as loops, flagvalues, counts etc. are not given in the diagram therefore you can define them as your ownextra variables in the program Your program will have a class called FlightController that is going to be derived from two base classes which are called LaunchController and LandingController. The FlightController class inherits all accessible data fields and methods from the LandingController and LaunchController classes. Inside the FlightController class, you…arrow_forwardDeclare a class/struct named NutritionData that contains these private fields foodName (string) servingSize (int) calFromCarb (double) calFromFat (double) calFromProtein (double) Use the data types in parentheses for the fields. Note that you need to use the proper C++ syntax for the fields. Each field should have a comment documenting what it is for. Place one comment above each field. Add the public default constructor. Read the textbook for the syntax of the default constructor. Write the body of the default constructor inline. The default constructor initializes the fields so that the food name is an empty string and all other fields are 0 for int and 0.0 for double. Add public mutator member functions to set the fields. One mutator member function for each field. Each mutator member function's name should begin with the word 'set' followed by the field name with the first letter changed to uppercase. Each member function should have a comment above the declaration describing its…arrow_forwardPLease! In c++ Important requirements for all questions: • All data members must be declared as “private” • No global variable is allowed to be declared and used • Methods within the class and the requested functions cannot have “cin” or “cout” but it should make use of parameters and return value instead. • “cin” and “cout” should be done in main() or any testing functions • Make sure that you clearly show how the C++ class, its methods and all the functions are being called at least twice and print out its return value and its results properly.arrow_forward
- Demonstrate the usage of the ACTION and METHOD elements in code by describing their respective functions on a form.arrow_forwardPlease refer to the pic and answer the questionsarrow_forwardPlease use C++ PROGRAMMING LANGUAGE to answer the following question Payment Management System (personal bookkeeping system) where individuals (more than one) can make multiple payments. The ability to pay for the transactions is related to banking module of the project. Three modules: Person, Payment and Account. Account module should be integrated in the Person’s module. Account class’ object need to be data member of Person class. Payment Define a class named Payment that contains member variables of type float that stores the amount of the payment, string that store the type of payment (bills, shopping, grocery, fuel, medicine, others) and appropriate accessor and mutator methods. Also create a member function named paymentDetails that outputs an English sentence that describes the amount and type of the payment. Next define a class named CashPayment that is derived from Payment. This class should redefine the paymentDetails function to indicate that the payment is in cash.…arrow_forward
- PLease! In c++ Important requirements for all questions: • All data members must be declared as “private” • No global variable is allowed to be declared and used • Methods within the class and the requested functions cannot have “cin” or “cout” but it should make use of parameters and return value instead. • “cin” and “cout” should be done in main() or any testing functions • Make sure that you clearly show how the C++ class, its methods and all the functions are being called at least twice and print out its return value and its results properly. This is just a practice question.arrow_forwardPlease help me with this Thank you Use C++ Write a class Teacher that contains the attribute teacher name, age and address. It alsocontains member function to input and display its attributes. Write another class Author Writeanother class Writer that contains the attributes writer name, address and number of books writtenby him. It also contains member functions to input and display its attributes. Write a third classScholar that inherits both Teacher and Writer classes.arrow_forwardUsing C++ and Visual Studios Using your own creativity, make a set of class templates that have these features: For this class template, put everything in one place--do not declare the member functions and have separate definition of the member functions elsewhere. Keep them in one place. Include a private variable. Include a constructor that loads the private variable when constructed. Include a destructor that clears the private variable to zero. Include set and get functions to set and get the private variable.arrow_forward
- Using C++ and Visual Studios Using your own creativity, make a set of class templates that have these features: For this class template, put everything in one place--do not declare the member functions and have separate definition of the member functions elsewhere. Keep them in one place. Include a private variable. Include a constructor that loads the private variable when constructed. Include a destructor that clears the private variable to zero. Include set and get functions to set and get the private variable.arrow_forwardCreate a class Person with data members Name, Age and Address. Create another class Teacher with data members Qualification and Department. Also create another class Student with data member Program and Semester. Both classes are inherited from the class Person. Every class has at least one constructor which uses base class constructor. Create member function Show Data () in each to display the information of the class. C++arrow_forwardStruggling with a c++ task. The class dateType was designed to implement the date in a program, but the member function setDate and the constructor do not check whether the date is valid before storing the date in the member variables. Rewrite the definitions of the function setDate and the constructor so that the values for the month, day, and year are checked before storing the date into the member variables. Add a member function, isLeapYear, to check whether a year is a leap year. Moreover, write a test program to test your class. Input should be format month day year with each separated by a space. Output should resemble the following: Date #: month-day-year An example of the program is shown below: Date 1: 3-15-2008 this is a leap year If the year is a leap year, print the date and a message indicating it is a leap year, otherwise print a message indicating that it is not a leap year. The header file for the class dateType has been provided: #ifndef date_H #define date_H…arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





