Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please help me create this program in Java 7 or 8. Using very basic knowledge of

ID: 3809553 • Letter: P

Question

Please help me create this program in Java 7 or 8. Using very basic knowledge of Java as I am only 7 chapters in to my intro to Java Class.No copy and paste from stackoverflow. I need an original program that I can study from with no errors in the IDE(eclipse neon). Thanks!

Using the StringBulderClass write an program that takes this text below and substitutes your name every time there is an "it" or "It". The program also should remove the commas and replace them with colons. Then print the resulting string.

"It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to Heaven, we were all going direct the other way-- in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only."

Explanation / Answer

Following Java program does following:

a) Reads given name from standard input.

b) Reads given line of text to process from standard input.

c) Finds index of next occurance of 'It'. (index1)

d) Finds index of next occurance of 'it'. (index2)

e) Finds index of next occurance of ','. (index3)  

f) Finds minimum index among index1, index2 and index3. Note that any index that is -1 is considered invalid as it implies the corresponding string 'It' / 'it' / ',' is NOT found.

g) Append string until minimum index and replace the found string with given name or colon as the case may be. Update the index for next occurance of the replaced string.

h) Repeat above two steps until none of the strings are found in the given text.

File: StringBuilderApp.java

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote