Question: Write a project to perform manipulations on a string of characters. Write a program that will allow the user to change every occurrence of the

 Write a project to perform manipulations on a string of characters.

Write a project to perform manipulations on a string of characters. Write a program that will allow the user to change every occurrence of the space character with the string, "blank". Create two classes. Replacer class, which has at least two fields, the original string, stored in a string object and the converted string, stored in a StringBuilder object. (read the Java API documentation as shown in lecture) The constructor method should take a String as a parameter and assign it to both fields. You need a replace() method that will take in two parameters, the character to be replaced and the sequence of characters to replace it with. This method will use StringBuilder methods and logic to change all occurrences of the original string to a new string, while still preserving a copy of the original string. Write a get() method to get the original string. Write a get() method to get the converted string. Write a set() method to change the original string to a new string provided by the user. Driver class: Write a class with the main() method that tests your Replacer class. The user can enter strings, and convert each to another string using the replace() method that you wrote. Use the get() methods to print results to the screen. Allow the user to enter a brand new string until they decide they are done

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!