Question: Programming Write a static void method rewrite that takes in a given text and modifies the contents of the text based on some numbers supplied,

Programming
Write a static void method rewrite that takes in a given text and modifies the contents of the text based on some numbers supplied, printing out the modified message at the end.
The method should take in these parameters:
String text: the text that will be translated
int startingIndex: the index at which the text will begin to be rewritten
int endingIndex: the index at which the text will stop being rewritten (exclusive)
char letter: the letter that the method uses to rewrite other characters
For example, let's say our text is "Matt and Elba are my best friends!", our starting index is 3, our ending index is 12, and our letter is #. We will change every letter in the given interval to be equal to our char letter. In this case, we will print out "Mat#########a are my best friends!"
If our text is "Dogs and Cats rock", our starting index is 5, our ending index is 7, and our letter is &, we will print out Dogs &&d Cats rock
You can assume that ending indices will always come after starting indices and that both the starting and ending index are within the bounds of the text.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!