CIS 3120
Design and Implementation of Software Applications I
Lab 1 - Part 2

What to Do

  1. start with the example that stores in an array 5 random numbers between 0 and 100;
  2. public class Ex4a { 
     	public static void main(String[] args) {
    		int[] A = new int[5]; 
    		for(int i=0; i<A.length; i++) {
    			A[i] = (int)(Math.random() * 100);
    		} 
    		for(int i=0; i<A.length; i++) {
    			System.out.println("i[" + i + "]=" + A[i]); 
    		} 
    	} 
    } 
    			
  3. write a method that finds the minimum number in array and returns its index;
  4. modify "main" method to call above method and print out the smallest number
  5. write a method that finds the maximum number in array and returns its index;
  6. modify "main" method to call above method and print out the biggest number
  7. modify "main" method to ask the user how big she wants the array to be, read the user's answer from the keyboard as a String, convert the String to an int and use it as the size of the array
  8. modify "main" method to ask the user enter numbers (one at a time) to fill created array; make sure that program will ask user so many times that all elements in array will be defined;

Additional info: Reading user input from console

What to Submit

You should complete lab by the indicated due date. Please read this carefully:

Results of the labs and assignments that do not involve usage of web server (lab #1) should be submitted as follows: