Question: program in java //4) Write method factors() that takes a single int typed decimal //number, with the restriction that the input number is NOT prime.
program in java
//4) Write method factors() that takes a single int typed decimal
//number, with the restriction that the input number is NOT prime.
//Return all factors of the number as a sequence of numbers held in
//an array of int[]. Declare the local int[] array with size 10.
//Since all elements of the int[] factors array will be initialized
//to 0, and 0 cannot be a factor, consider any element with value of
//0 as not being used. Use a counted for-loop, to calculate the
//factors. Also include the number as a factor of itself. Copy and
//paste from the Prime number example discussed in class; re-factor
//it to write method factors().
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
