PRO192_-_PE02_-_SU_2025_4005.webp
T

PRO192_-_PE02_-_SU_2025_4005.webp

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
Chưa có bình luận nào.

Thông tin

Category
PRO192
Thêm bởi
ThuyPhuong86
Ngày thêm
Lượt xem
2,187
Lượt bình luận
0
Rating
0.00 star(s) 0 đánh giá

Share this media

Back
Bên trên Bottom