Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Genetic Databases

Authors: Martin J. Bishop

1st Edition

0121016250, 978-0121016258

More Books

Students also viewed these Databases questions

Question

Did the team members feel that their work mattered

Answered: 1 week ago

Question

2. What process will you put in place to address conflicts?

Answered: 1 week ago