Question: * * Multiple Method Return Project * * For this application, you will write methods that satisfy a number of program requirements. * Start by
Multiple Method Return Project
For this application, you will write methods that satisfy a number of program
requirements.
Start by creating your main method, this will be like all others. You will then
send data to methods that will perform
certain functions and then they will return the result to the main method and
the main method will print out the result.
takes an array of ints as a parameter and returns the sum of the integers in
the array.
takes an array of ints as a parameter and returns the double average of the
integers in the array.
takes an array of ints as a parameter and returns the largest integer in the
array.
takes an array of ints as a parameter and returns the smalles integer in the
array.
takes an array of ints as a parameter and returns the double average of the
even values in the array.
dont forget to alter the class and file name with your name, and comment your
code
class MultipleMethodsProject
public static void mainString args
Scanner scan new ScannerSystemin;
establish a fixed array to accept user input
int array new int;
Prompt the user for the integers
System.out.printlnPlease enter integers";
Loop to place values in to elements of the array,
note how the scan is within the for loop to step in to each element
space and place the input value
for int i ; i array.length; i
int arrayInt scan.nextInt;
arrayi arrayInt;
you need to create each of the methods called from the print statement,
outside of the main
System.out.println
Sum: sumarray;
System.out.printlnAverage: averagearray;
System.out.printlnLargest: findMaxarray;
System.out.printlnSmallest: findMinarray;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
