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

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 18PE
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
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning