Question 04: (03 marks)
Kizspy.me
The interface IData Processor below is already given in Java code format, thus you can use it
without creating an IData Processor.java file.
<<interface>>
IDataProcessor
+findLargestNumber(strInput: String): int
+ calculate AverageNumbers(strInput: String): double
Write a class named DataHandler, which implements the interface IData Processor. The class
DataHandler implements all methods in IDataProcessor as below:
+findLargest Number(strInput: String): int - return the largest integer in the string strinput
+calculateAverageNumbers(strInput: String): double return the average of all integers in the
string strinput.
Hints: Assuming that the string strinput consists of words separated by a space, a word can be a
string of letters or a string of digits(positive integer). You can refer to the split() method of the
String class.
-The Main class is provided for you in binary form. You only test your program by running the
binary file. There are several test cases for you, as follows:
Zoom
+ 100%
Close