27 lines
805 B
Java
27 lines
805 B
Java
public class Testat1A {
|
|
|
|
/**
|
|
* Returns the average of all values in the array that are above the given
|
|
* threshold.
|
|
*
|
|
* @param arr The input array of integers.
|
|
* @param threshold The threshold value.
|
|
* @return The average of all values above the threshold, or 0 if none are
|
|
* found.
|
|
*/
|
|
public static double calculateMeanAbove(int[] arr, int threshold) {
|
|
// TODO: implement Aufgabe 1
|
|
return -42.0;
|
|
}
|
|
|
|
/**
|
|
* Returns the average of all rows in a 2D array.
|
|
*
|
|
* @param arr The input 2D array of integers.
|
|
* @return An array containing the average of each row.
|
|
*/
|
|
public static double[] calculateRowMean(int[][] arr) {
|
|
// TODO: implement Aufgabe 2
|
|
return new double[42];
|
|
}
|
|
} |