Question: I need it in java and word file 3. Write a method countSquares that goes through an array, counting and then returning thoe number of
3. Write a method countSquares that goes through an array, counting and then returning thoe number of perfect squares in the array using the following isSquare method: public static boolean isSquare (int num) double sqrt Math.sqrt(num); return sqrt "" int) sqrt); Example: int a[] = {4,6,3,9,8, 16); System.out.print (countSquares (a)):1/ will print "3
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
