question should be done in C++, please give explanation and running result. 1. For this question, we need to provide more information about where the mismatch of the text file is happening.  Write a recursive function called list_mismatched_lines that takes 2 filenames as input arguments and displays to the screen all mismatched lines in those files. This function should use hashing techniques and shall not compare strings to detect mismatch.  The signature of this function should be: void list_mismatched_lines(std::string file1, std::string file2);  In file1.txt, it contains "My dear C++ class. I hope that you enjoy this assignment. " In file2.txt, it contains "My dear C++ class. I hope that you like this assignment. " Example: Running the following line of code, should print to the screen the mismatched lines only, from both files. list_mismatched_lines(file1, file2);  The following output should be seen on the screen:  file1.txt: I hope that you enjoy this assignment. file2.txt: I hope that you like this assignment.  Please note that if you have multiple mismatching lines, all of them should be printed out to the screen.   2. Now let’s be more precise and write a function that pinpoints the mismatched words only together with the line number where the mismatch occurred. Here also you should use recursive functions and you should use hashing techniques (no one on one comparison of strings from the 2 files). Your function signature should be: void list_mismatched_words(std::string file1, std::string file2); By calling this function on your same previous files, the output should be: file1.txt: enjoy (line 2) file2.txt: like (line 2)  Please note that if you have multiple mismatching words, all of them should be printed out to the screen

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
icon
Related questions
Question

The question should be done in C++, please give explanation and running result.

1. For this question, we need to provide more information about where the mismatch of the text file is happening. 

Write a recursive function called list_mismatched_lines that takes 2 filenames as input arguments and displays to the screen all mismatched lines in those files. This function should use hashing techniques and shall not compare strings to detect mismatch. 

The signature of this function should be:

void list_mismatched_lines(std::string file1, std::string file2); 

In file1.txt, it contains "My dear C++ class. I hope that you enjoy this assignment. "

In file2.txt, it contains "My dear C++ class. I hope that you like this assignment. "

Example: Running the following line of code, should print to the screen the mismatched lines only, from both files.

list_mismatched_lines(file1, file2); 

The following output should be seen on the screen: 

file1.txt: I hope that you enjoy this assignment.
file2.txt: I hope that you like this assignment. 

Please note that if you have multiple mismatching lines, all of them should be printed out to the screen.

 

2. Now let’s be more precise and write a function that pinpoints the mismatched words only together with the line number where the mismatch occurred. Here also you should use recursive functions and you should use hashing techniques (no one on one comparison of strings from the 2 files).

Your function signature should be:

void list_mismatched_words(std::string file1, std::string file2);

By calling this function on your same previous files, the output should be:

file1.txt: enjoy (line 2)
file2.txt: like (line 2) 

Please note that if you have multiple mismatching words, all of them should be printed out to the screen. 

Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Hash Table
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
Database System Concepts
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)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education