Do the following: Create a program that takes two filenames from standard input and compares whether they are the same character-for-character. That is, if something is different, whether it's a space, a newline, a letter, some punctuation, it doesn't matter. If any of those are different, then the files are "different." The input format: The only input is two filenames separated by a space. Example: file1.txt file2.txt The output format: Simply write to standard output either " is different from " or " and are the same." Example: file1.txt is different from file2.txt.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter13: File Input And Output
Section: Chapter Questions
Problem 6PE
icon
Related questions
Question

C++

 

Do the following:
Create a program that takes two filenames from standard input and compares whether they
are the same character-for-character.
That is, if something is different, whether it's a space, a newline, a letter, some punctuation, it
doesn't matter. If any of those are different, then the files are "different."
The input format:
The only input is two filenames separated by a space.
Example:
file1.txt file2.txt
The output format:
Simply write to standard output either "<file1> is different from <file2>." or "<file1> and
<file2> are the same."
Example:
file1.txt is different from file2.txt.
Transcribed Image Text:Do the following: Create a program that takes two filenames from standard input and compares whether they are the same character-for-character. That is, if something is different, whether it's a space, a newline, a letter, some punctuation, it doesn't matter. If any of those are different, then the files are "different." The input format: The only input is two filenames separated by a space. Example: file1.txt file2.txt The output format: Simply write to standard output either "<file1> is different from <file2>." or "<file1> and <file2> are the same." Example: file1.txt is different from file2.txt.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
File Input and Output Operations
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT