Question: Project 7_1: Write a method called divischeck that takes an array of integers as a parameter and returns the number of elements that are divisible
Project 7_1: Write a method called divischeck that takes an array of integers as a parameter and returns the number of elements that are divisible by 2, but not by 3. Then, in the main method, instantiate an array of 20 random integers between 1 and 10 and pass it to divisCheck. Print the original array and the return value as follows. Sample Output Random array: 2, 3, 9, 10, 1, 10, 10, 8, 3, 4, 2, 5, 6, 7, 1, 6, 7, 8, 8, 2} Elements divisible by 2, but not by 3: 10 Project 7_2: Write a method called threeLetterWords that takes an array of Strings as a parameter and returns the number of words of length three. Then test your method as follows: In the main method, instantiate an array of Strings with 10 words of your choice. Pass the array as a parameter to threeLetterwords. Print out the return value. Make sure the method gives the correct output! Sample Output Words: ("cat", "boy", "girl","potato", "mouse", "cheese", "book", "cup", "water", "pen") Words of length 3: 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
