Question: The language is java. Please implement methods for the prompts with simple explainations. Thank you Section 1140 pts): Method writing (You are only required to
Section 1140 pts): Method writing (You are only required to implement methods) 1) Implement a method called reverse takes an integer parameter, say num, and returns the reversed num integer Example: reversel12345) returns 54321 reversel1100) returns 11 2) implement a method called composite that takes an integer, say n, determines if it is not divisible by any number between 2 and n/2 Example composite(10) returns true composite 11) returnsfalse 3) Implement method searchArray which takes String array, say A, and string K If K is in the array K it returns 1 and if K is not in the array, then it returns-1 Example: Assume A-l"wku ekunku "ukwofs searchArraylA,"abc") returns 1 saerchArray/A wku") return 1 4 public class Point //this class defines a point in two-dimensional space with x and y coordinate private int xCor private int yCo Class method distance: determines distance between two pints p-(xl.y1) and q (x2,y2). Note distance dis Vx1-x2)1-y2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
