Question: In this assignment you will create several methods, each doing some specific task. You only need to edit the Main.java file, which has some dummy

In this assignment you will create several methods, each doing some specific task. You only need to edit the Main.java file, which has some dummy/stub boilerplate code already in place. The code can be compiled, but the results are not correct. You need to fix each method so it does what it's supposed to, according to the following description:
Method sum(...) that expects two integers, and returns the sum of the expected integers.
Method difference(...) that expects two integers, and returns the difference between the expected integers.
Method division(...) that expects two integers, and returns the first number divided by the second (hint: pay attention to the types of the variables involved!).
Method multiplication(...) that expects two integers, and returns their values multiplied.
Method remainder(...) that expects two integers, and returns the remainder of the division of the first number by the second.
Method isOdd(...) that expects one integer, and returns true if the given value is odd, false otherwise.
Method isEven(...) that expects one integer, and returns true if the given value is even, false otherwise.
Method lowest(...) that expects an array of integers and returns the lowest value inside the given array.
Method highest(...) that expects an array of integers and returns the highest value inside the given array.
Method average(...) that expects an array of integers and returns the average of the values inside the given array.
Method reversed(...) that expects an array of integers and returns a new array in reversed order.
Method determinant(...) that expects a 2-D array of integers that represents a 2 by 2 matrix, and returns the determinant of that matrix.
Boilerplate code:
public class Main {
public static void main(String[] args){
// Test your method implementations here!
}
// Modify all the methods below, so they do what they are supposed to do.
static int sum(int a, int b){ return 0; }
static int difference(int a, int b){ return 0; }
static double division(int a, int b){ return 0; }
static int multiplication(int a, int b){ return 0; }
static int remainder(int a, int b){ return 0; }
static boolean isOdd(int a){ return true; }
static boolean isEven(int a){ return true; }
static int lowest(int[] list){ return 0; }
static int highest(int[] list){ return 0; }
static double average(int[] list){ return 0; }
static int[] reversed(int[] list){ return list; }
static int determinant(int[][] matrix){ return 0; }
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!