Question
Exercise 2A [5%] Create a class called TextIO. Exercise 2B [25%] Add a public and static method called readText that returns TextStatistics. The method should
Exercise 2A [5%] Create a class called TextIO. Exercise 2B [25%] Add a public and static method called readText that returns TextStatistics. The method should have a String parameter that specifies a file name (and optionally path). Read the specified file and count the frequency of each Latin letter and Arabic number and update the frequencies in the TextStatistics object that the method returns. Your method should declare an appropriate exception. Should you have not completed Exercise 1, add a private an int array with 36 elements to store the frequencies of alphanumeric symbols in the text. Store the Latin letters in the text in the first 26 elements and the Arabic numbers in the last 10 elements. Return the array instead of the TextStatistics object. You can test this class using input.txt
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