Question: A composite number is defined to be the one that is positive integer and has at least one divisor other than 1 and itself. Negative

A composite number is defined to be the one that is positive integer and has at least one divisor other than 1 and itself. Negative numbers are not composite by definition. A composite number can be formed by multiplying two smaller positive integers. Write a method named isComposite that returns true if its integer argument is composite, otherwise it returns false. use the method signature:

A composite number is defined to be the one that is positive

integer and has at least one divisor other than 1 and itself.

Code start with boolean:

/**

* This method returns true if its integer argument is composite, otherwise it returns false

* A number is defined to be the one that is positive integer and has at least one divisor other than 1 and itself.

* For example, 4 and 6 are composite whereas 3 and 5 are not.

*/

public static boolean isComposite(int input) {

// DELETE THE LINE BELOW ONCE YOU IMPLEMENT THE CALL!

throw new RuntimeException("not implemented!");

}

input return false false false false true (because 2 is a divisor) false true (3 is a divisor) false true (2,4 are divisors) true (3 is a divisor) true (2,5 are divisors) false true (2,3,4,6 are divisors) 13 false -14 false 15 true (3,5 are are divisors)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!