Enter id:6
OUTPUT:
Enter id: 10
OUTPUT:
6, LAPTOP, 35.31
OUTPUT:
6, LAPTOP, 123.11
N/A
Question 4:
(3 marks)
The interface IProcess below is already given in java code format, thus you can use it without creating
IProcess.java file.:
<<interface>>
IProcess
+ countWords(str1:String, str2: String):int
+ getLastWord(str:String):String
Write a class named MyClass, which implements the IProcess interface. The MyClass class implements all methods in IProcess as below:
countWords(str1:String, str2: String):int-count the number of words in the string str1 that are equal to the string str2 (not case sensitive).
+ 100%
Zoom
Close