Question: Write a method called isFound that accepts as an arguments an array of integers (call numArr) and and an integer variable (call it x). The
Write a method called isFound that accepts as an arguments an array of integers (call numArr) and and an integer variable (call it x). The method returns true or false depending if x was found in numArr or not.
- Demonstrate the method by calling it from the main() and passing to it an array of integers (declare and initialize with 10 values in the main()) and a value to search for. Print a message telling the user if the value x was found or not in the main();
Question 2:
Write a method called addArr that accepts as an arguments an array of integers (call numArr). The method returns the sum of all the values in it.
- Demonstrate the method by calling it from the main() and passing to it an array of integers (declare and initialize with 10 random values generated using the Random class in the range 1-100. Print the sum in the main().
Question 3:
Write a method called copyRev that accepts as an arguments an array of integers (call numArr). The method will create another array (call it revNumArr) and fill it with the elements of numArr in reverse order.
- Demonstrate the method by calling it from the main() and passing to it an array of integers (declare and initialize with 10 random values generated using the Random class in the range 1-100. Print the elements of numArr and revNumArr in the copyRev().
Step by Step Solution
There are 3 Steps involved in it
Here are the Java methods and their demonstrations in the main 1 isFound method Java public boolean ... View full answer
Get step-by-step solutions from verified subject matter experts
