Write a program that opens two text files and reads their contents into two separate queues. The program should then determine whether the files are identical by comparing the characters in the queues. When two nonidentical characters are encountered, the program should display a message indicating that the files are not the same. If both queues contain the same set of characters, a message should be displayed indicating that the files are identical. Sample Run Suppose we have two files with the smae text: This is my text file. The output is: The files are identical. file1.txt: This is my text file. file2.txt: This is another text file. The output is: The files are not identical.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 16PE: The implementation of a queue in an array, as given in this chapter, uses the variable count to...
icon
Related questions
Question

In C++ language. Please look at the instructions and help with program. This is for intermediate not advanced. so help me understand please 

Write a program that opens two text files and reads their contents into two separate queues. The
program should then determine whether the files are identical by comparing the characters in the
queues. When two nonidentical characters are encountered, the program should display a
message indicating that the files are not the same. If both queues contain the same set of
characters, a message should be displayed indicating that the files are identical.
Sample Run
Suppose we have two files with the smae text:
This is my text file.
The output is:
The files are identical.
==
file1.txt:
This is my text file.
file2.txt:
This is another text file.
The output is:
The files are not identical.
Transcribed Image Text:Write a program that opens two text files and reads their contents into two separate queues. The program should then determine whether the files are identical by comparing the characters in the queues. When two nonidentical characters are encountered, the program should display a message indicating that the files are not the same. If both queues contain the same set of characters, a message should be displayed indicating that the files are identical. Sample Run Suppose we have two files with the smae text: This is my text file. The output is: The files are identical. == file1.txt: This is my text file. file2.txt: This is another text file. The output is: The files are not identical.
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 6 images

Blurred answer
Knowledge Booster
Files and Directory
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