Print the total number of words in the file. Print the total number of different words (case sensitive, meaning “We” and “we” are two different words) in the file. Print all words in ascending order (based on the ASCII code) without duplication. Write a pattern match method to find the location(s) of a specific word (a character string up to twelve characters, e.g. system). This method should return all line number(s) and location(s) of the word(s) found in the file. Print all line(s) with line number(s) of the file where the word is funds by invoking the method of 4). Under each output line indicate the location(s) of the first character of the matched word (refer to the output example below). Empty lines are lines, they also have their own unique line numbers. java Project mytext.txt The total number of word in the file is: 501 The total number of different words in the file is: 465 Words of the input file in ascending order without duplication: // here are output of all words in ascending order without duplication // (the content of this portion is subject to the input text file) Please enter a word to be searched: system Line number 10 complete your computation a 64 bit processor system running Linux Operating System is ^ Line number 487 entire system should be based on a complete software system infrastructure design. ^ ^ Please enter a word to be searched: Albuquerque The word Albuquerque is not found in the text file. Please enter a word to be searched: EINPUT Bye!
- Print the total number of words in the file.
- Print the total number of different words (case sensitive, meaning “We” and “we” are two different words) in the file.
- Print all words in ascending order (based on the ASCII code) without duplication.
- Write a pattern match method to find the location(s) of a specific word (a character string up to twelve characters, e.g. system). This method should return all line number(s) and location(s) of the word(s) found in the file.
- Print all line(s) with line number(s) of the file where the word is funds by invoking the method of 4). Under each output line indicate the location(s) of the first character of the matched word (refer to the output example below).
- Empty lines are lines, they also have their own unique line numbers.
java Project mytext.txt
The total number of word in the file is: 501
The total number of different words in the file is: 465
Words of the input file in ascending order without duplication:
// here are output of all words in ascending order without duplication
// (the content of this portion is subject to the input text file)
Please enter a word to be searched: system <Enter>
Line number 10
complete your computation a 64 bit processor system running Linux
^
Line number 487
entire system should be based on a complete software system infrastructure design.
^ ^
Please enter a word to be searched: Albuquerque <Enter>
The word Albuquerque is not found in the text file.
Please enter a word to be searched: EINPUT <Enter>
Bye!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 3 images