Problem Description: Your friend keeps finding mistakes in his code due to unmatched brackets errors. You, as a good friend, decided to help him by developing a program that will find errors in the usage of different types of brackets. A Code can contain any of the following brackets []{}(), where the opening brackets are [,{, and (and the closing brackets corresponding to them are ],}, and ). Being a good friend, you want your program not to only detect that there is an error in the usage of brackets, but also point to the exact place in the code with the problematic bracket. Using C++/CPP Requirements: 1. Write a program that finds the first unmatched closing bracket which either does not have an opening bracket before it, or closes the wrong opening bracket, like } in ()[}. If there are no such mistakes, then it should find the first unmatched opening bracket without the corresponding closing bracket after it, like (in {}[]. If there are no mistakes, you should output "No Mistakes". 2. If there exists a mistake then your program should output the index of the first unmatched closing bracket in the input string, and if there are no unmatched closing brackets, output the index of the first unmatched opening bracket in the input string. Note: In case of unmatched brackets you will always look for the first unmatched closing bracket, if there are no unmatched closing brackets, then you will look for the first unmatched opening bracket.
Problem Description: Your friend keeps finding mistakes in his code due to unmatched brackets errors. You, as a good friend, decided to help him by developing a program that will find errors in the usage of different types of brackets. A Code can contain any of the following brackets []{}(), where the opening brackets are [,{, and (and the closing brackets corresponding to them are ],}, and ). Being a good friend, you want your program not to only detect that there is an error in the usage of brackets, but also point to the exact place in the code with the problematic bracket. Using C++/CPP Requirements: 1. Write a program that finds the first unmatched closing bracket which either does not have an opening bracket before it, or closes the wrong opening bracket, like } in ()[}. If there are no such mistakes, then it should find the first unmatched opening bracket without the corresponding closing bracket after it, like (in {}[]. If there are no mistakes, you should output "No Mistakes". 2. If there exists a mistake then your program should output the index of the first unmatched closing bracket in the input string, and if there are no unmatched closing brackets, output the index of the first unmatched opening bracket in the input string. Note: In case of unmatched brackets you will always look for the first unmatched closing bracket, if there are no unmatched closing brackets, then you will look for the first unmatched opening bracket.
Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
Related questions
Question
100%
i need this code in c++ and running plz with pictures of it running
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
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.Recommended textbooks for you
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education