View the step-by-step solution to:

You will write a FileManipulator Class. This class has two private data fields. One for a File, the other for an ArrayList for Strings.

You will write a FileManipulator Class. This class has two private data fields. One for a File, the other for an ArrayList for Strings. The Constructor should take a String that represents a valid file path. This String will be used to instantiate the File. The ArrayList should then be filled with lines of the File in the constructor.

You will then need to write the reverse, removePlurals, and the stutter methods. There descriptions are below.

The methods you need to write are:

public FileManipulator(String fileName){           

}

/**

* This reverses the lines of the file and also reverses

* the order of the words in each line of the file.

* This preserves the original line breaks.

*/

public void reverse(){

}

/**

* This prints the file with the plurals removed.

* Plurals are words that end with "s"

* This preserves the original line breaks.

*/

public void removePlurals(){

      

}

/**

* This prints each word in the file k times in a row.

* This preserves the original line breaks.

* @param k

*/

public void stutter(int k){

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question