Question: Question 1: Write a parent abstract class MyDictionary in java with the following abstract methods: [3 Marks] Int countCharacters(File), to count total characters of the

Question 1:

Write a parent abstract class MyDictionary in java with the following abstract methods: [3 Marks]

  1. Int countCharacters(File), to count total characters of the given text file excluding spaces and display it. [4 Marks]
  2. Int countWords(File), to count words of the given text file and display it. [3 Marks]
  3. Int countVowels(File), to count words of the given text file and display it. [4 Marks]
  4. Boolean searchWord(File, String), takes a word as a string and searches that word in the given text file, if found returns true else returns false. [4 Marks]
  5. File openMyFile(String) used to open the given text file and returns it as a reference object. Also handle necessary exceptions to eliminate execution inconsistencies. [2 Marks]
  6. Void closeFile(File) used to close the file. [2 Marks]

Now, write a child class TestDictionary and inherit MyDictionary class to provide implementation to all above methods. Also write a main method in the child class to test all methods of the child class. [3 Marks]

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!