Question
Programming Task 1: Write a method that uses a loop to find the greatest number in an integer array. The method only takes one parameter
Programming Task 1:
Write a method that uses a loop to find the greatest number in an integer array. The method only takes one parameter that is an integer array and returns the value of the greatest element of it. Additionally, you are also required to provide a main method in which the program asks the user to first input an integer n which denotes the number of elements in the array, and then the n numbers in the array. Type checking is required, the program should call the method after nvalid numbers are given.
Programming Task 2:
Write a recursive version for the method in Task 1. You may provide another Java file for this task.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started