Question
Design and implement a program that compares two text input files, line by line, for equality. Print any lines that are not equivalent. SPECIFICATION OF
Design and implement a program that compares two text input files, line by line, for equality. Print any lines that are not equivalent.
SPECIFICATION OF PROMPTS, LABELS AND OUTPUT: Your code should prompt for two filenames to identify the files. Each prompt should be "name of file to compare: ". The program produces no other output if it turns out that the files are identical. Otherwise, for every pair of lines in the two files that differ, the line number is printed out, followed by a colon and then on the next line the line from the first file is printed followed by, on the next line the line from the second file. (Thus each line difference in the files results in 3 lines of output: a line number and then the two lines from the files.) If one file finishes first then its lines should be represented in the output by the string null.
For example suppose that a file named f1 contained: so long it's been good to know you and a file named f2 contained: so long its been good to know you and this dusty old dust storm is then here how an interactive session with this program would look: name of file to compare: f1 name of file to compare: f2 2: it's been its been 4: null and this dusty old 5: null dust storm is
SPECIFICATION OF NAMES: Your application class should be called TextComparer
Need it to work on eclipse as well thank you
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started