Last active
April 6, 2016 05:33
-
-
Save dnkm/f1e915e24d0606d8a52991519769afd3 to your computer and use it in GitHub Desktop.
homework1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.lang.*; | |
class Homework1 { | |
public static void main(String args[]) { | |
int[] testArray = new int[10]; | |
// exercise 1 | |
fillWithRandomIntegers(testArray, 0, 100); | |
printArray(testArray); | |
// exercise 2 | |
int max = getMax(testArray); | |
System.out.println("Max is " + max); | |
// exercise 3 | |
reverseArray(testArray); | |
printArray(testArray); | |
} | |
private static void fillWithRandomIntegers(int[] array, int min, int max) { | |
/* fills array with random integers between min and max */ | |
/* implement */ | |
} | |
private static void printArray(int [] array) { | |
/* prints the array */ | |
/* implement */ | |
} | |
private static int getMax(int[] array) { | |
/* returns the maximum integer from the array */ | |
/* implement */ | |
} | |
private static void reverseArray(int[] array) { | |
/* reverses the array */ | |
/* implement */ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment