☑Kizspy.me
Question 04: (03 marks)
Zoom
The interface IUtilities below is already given in Java code format, thus you can use it without
creating an IUtilities.java file:
<<interface>>
IUtilities
+ getLengthOfLongest Word(sentence:String):int
+ calculate Average Value(str:String):double
Write a class named MyUtilities, which implements the interface IUtilities. The class MyUtilities
implements all methods in IUtilities as below:
+ getLength Of Longest Word (sentence: String): int - return the length of the longest word (the word
with the most characters) in the string sentence. Suppose a sentence consists of words separated
by a space
+ calculateAverageValue(str: String): double - return the average of even digits in the string str
+ 100%
Close