Question
Java: please make sure code compiles and runs before posting. Write a program that reads from the attached text file called Logic.txt one word at
Java: please make sure code compiles and runs before posting.
Write a program that reads from the attached text file called Logic.txt one word at a time. The program counts how many words start with the letters "is" (use startsWith method from String class to check for that), and prints each word with all the vowels replaced with ~ character (use replaceAll method from String class to replace all the vowels with the given replacement String). At the end, the program outputs the count of all the words that start with "is". See the expected output below:
"C~ntr~r~w~s~," c~nt~n~~d Tw~~dl~d~~, "~f ~t w~s s~, ~t m~ght b~; ~nd ~f ~t w~r~ s~, ~t w~~ld b~; b~t ~s ~t ~sn't, ~t ~~nt't. Th~t ~s l~g~c." 2 words start with "is".
Logic.txt content:
"Contrariwise," continued Tweedledee, "if it was so, it might be; and if it were so, it would be; but as it isn't, it aint't. That is logic."
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