Introduction ID Forgery has been a prevalent issue in the city of Einstakt, especially in bars. You are currently working in a government agency that tries to identify individuals sharing the same ID numbers and perform a formal investigation. Each day, your team travels to two random bars to collect the encoded IDs of each bar patron. Those with the same ID numbers will be approached and invited for an interrogation. At the end of each mission, a report with listings of guilty and innocent individuals will be sent to the senior team members for further processing. Your task is to write a program to decode the ID numbers, find the decoded ID duplicates (if there are any), and generate a report with decoded IDs of all the guilty and innocent individuals. Assumptions: • Each input file may contain a maximum of 100 encoded IDs. • Bar names will always be "Bar1" and “Bar2". • Each encoded and decoded ID may vary in length (8293, 00087, 49, ...). • Each encoded ID contains only numbers and parentheses. • Each encoded ID has m characters, where 1 <= m <= 100 • Two different encoded IDs that map to the same decoded ID number are considered duplicates. There will only be at most two people who share the same decoded IDs. • All ID encodings will always have balanced parentheses. • There will be no space in each encoded ID. Rules and Operations 1. To decode each ID, reverse the numbers in each pair of the matching parentheses, starting from the innermost pair. 2. Find the ID duplicates in both bar locations. 3. In your report, print the decoded IDs of both guilty and innocent

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

In c++. Read all instructions.

Introduction
ID Forgery has been a prevalent issue in the city of Einstakt, especially in bars. You
are currently working in a government agency that tries to identify individuals
sharing the same ID numbers and perform a formal investigation. Each day, your
team travels to two random bars to collect the encoded IDs of each bar patron.
Those with the same ID numbers will be approached and invited for an
interrogation. At the end of each mission, a report with listings of guilty and innocent
individuals will be sent to the senior team members for further processing.
Your task is to write a program to decode the ID numbers, find the decoded ID
duplicates (if there are any), and generate a report with decoded IDs of all the guilty
and innocent individuals.
Assumptions:
• Each input file may contain a maximum of 100 encoded IDs.
• Bar names will always be "Bar1" and “Bar2".
• Each encoded and decoded ID may vary in length (8293, 00087, 49, ...).
• Each encoded ID contains only numbers and parentheses.
• Each encoded ID has m characters, where 1 <= m <= 100
• Two different encoded IDs that map to the same decoded ID number are
considered duplicates. There will only be at most two people who share the
same decoded IDs.
• All ID encodings will always have balanced parentheses.
• There will be no space in each encoded ID.
Rules and Operations
1. To decode each ID, reverse the numbers in each pair of the matching
parentheses, starting from the innermost pair.
2. Find the ID duplicates in both bar locations.
3. In your report, print the decoded IDs of both guilty and innocent
individuals in ascending order. The output format is shown in the
examples below.
Note: You must use stacks and linked lists to implement your solution. All
linked list operations must be implemented using recursion!!! Points will
be deducted for using iterative implementations.
Examples
Example 1:
Input11.txt
Bar1
10(01)
(4321)
Bar2
(20)02
Bar1
(20)21
Bar2
3(021)
(4321)
Output11.txt
Guilty:
1234
// All ID(s) sorted in ascending order
Innocent:
0202
0221
// All ID(s) sorted in ascending order
1010
3120
Command line:
Idecode "input=input11.txt;output3Doutput11.txt" or /decode input=input11.txt
output=output11.txt
Example 2:
Input12.txt
Bar2
10(01)
Bar1
(01)10
Bar2
20(12)
Bar1
2(20)1
(4(23)1)
Bar2
1(432)
Output12.txt
Guilty:
1010
// All ID(s) sorted in ascending order
1234
2021
Command
Idecode "input=input12.txt;output=Doutput12.txt" or ./decode input=input12.txt
output=output12.txt
Example 3:
Input13.txt
Bar2
(75(700)1)3
35(748648)
13(05)6(7(6(83)00)1)
Bar1
4(21)5(37(9600))78
1005(3304)
Bar2
64(42)00587611(47)
(3001)
(78)407
0000000000000526(543)
6(542)1
Output13.txt
Innocent:
1003
62451
87407
0000000000000526345
1700573
// All ID(s) sorted in ascending order
10054033
35846847
135061638007
412596007378
64240058761174
Command line:
Idecode “input=input13.txt;output=Doutput13.txt" or ./decode input=input13.txt
output=output13.txt
Transcribed Image Text:Introduction ID Forgery has been a prevalent issue in the city of Einstakt, especially in bars. You are currently working in a government agency that tries to identify individuals sharing the same ID numbers and perform a formal investigation. Each day, your team travels to two random bars to collect the encoded IDs of each bar patron. Those with the same ID numbers will be approached and invited for an interrogation. At the end of each mission, a report with listings of guilty and innocent individuals will be sent to the senior team members for further processing. Your task is to write a program to decode the ID numbers, find the decoded ID duplicates (if there are any), and generate a report with decoded IDs of all the guilty and innocent individuals. Assumptions: • Each input file may contain a maximum of 100 encoded IDs. • Bar names will always be "Bar1" and “Bar2". • Each encoded and decoded ID may vary in length (8293, 00087, 49, ...). • Each encoded ID contains only numbers and parentheses. • Each encoded ID has m characters, where 1 <= m <= 100 • Two different encoded IDs that map to the same decoded ID number are considered duplicates. There will only be at most two people who share the same decoded IDs. • All ID encodings will always have balanced parentheses. • There will be no space in each encoded ID. Rules and Operations 1. To decode each ID, reverse the numbers in each pair of the matching parentheses, starting from the innermost pair. 2. Find the ID duplicates in both bar locations. 3. In your report, print the decoded IDs of both guilty and innocent individuals in ascending order. The output format is shown in the examples below. Note: You must use stacks and linked lists to implement your solution. All linked list operations must be implemented using recursion!!! Points will be deducted for using iterative implementations. Examples Example 1: Input11.txt Bar1 10(01) (4321) Bar2 (20)02 Bar1 (20)21 Bar2 3(021) (4321) Output11.txt Guilty: 1234 // All ID(s) sorted in ascending order Innocent: 0202 0221 // All ID(s) sorted in ascending order 1010 3120 Command line: Idecode "input=input11.txt;output3Doutput11.txt" or /decode input=input11.txt output=output11.txt Example 2: Input12.txt Bar2 10(01) Bar1 (01)10 Bar2 20(12) Bar1 2(20)1 (4(23)1) Bar2 1(432) Output12.txt Guilty: 1010 // All ID(s) sorted in ascending order 1234 2021 Command Idecode "input=input12.txt;output=Doutput12.txt" or ./decode input=input12.txt output=output12.txt Example 3: Input13.txt Bar2 (75(700)1)3 35(748648) 13(05)6(7(6(83)00)1) Bar1 4(21)5(37(9600))78 1005(3304) Bar2 64(42)00587611(47) (3001) (78)407 0000000000000526(543) 6(542)1 Output13.txt Innocent: 1003 62451 87407 0000000000000526345 1700573 // All ID(s) sorted in ascending order 10054033 35846847 135061638007 412596007378 64240058761174 Command line: Idecode “input=input13.txt;output=Doutput13.txt" or ./decode input=input13.txt output=output13.txt
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY