Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Things To do You now utilize what you have learned from the previous sample codes and write a class called FileParse.java that will go through
Things To do You now utilize what you have learned from the previous sample codes and write a class called FileParse.java that will go through a file and and essentially parse that file. The FileParse class should contain the following methods un 1. This method goes through a file and finds occurrences of the given word and keep:s track of the number of times the word appears in the file 2. Then the method will print out a message displaying the result. -Total number of occurrences: 15 3. Finally the method returns the number of occurrences as an int variable 4. For the purposes of this homework you are safe to assume there is only one occurrence of the word per line boolean dele 1. A method that goes through a file and deletes a particular line on the file where the line number is given. Note: Line number starts at 1 2. Once deletion is completed, the following message is displayed on the console 3. If the line number does not exist, you will print 4.Return true if the deletion was a success, false otherwise Line deleted! Line not found int retactortsting fieName. Sting rgi that 1. A method that goes through the file and replaces a word with a different word that was given to you 2. Once the replacement is done, a message in following format is displayed on the console showing how many words were replaced Number of words replaced: 15 3. If no words were found, print -No words found 4. Return the number of words replaced as an int variable
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started