go to previous page   go to home page   go to next page hear noise

Answer:

Yes.


Enhanced Minimum Program

Here is the minimum-finding program, now using an enhanced for loop:

class MinAlgorithm
{

  public static void main ( String[] args ) 
  {

    int[] array =  { -20, 19, 1, 5, -1, 27, 19, 5 } ;
    int   min;

    // initialize the current minimum
    min =  

    // scan the array
    for (     )
    { 
       if (    < min ) 

         min =  ; 

    }
      
    System.out.println("The minimum of this array is: " + min );
  }
}      

QUESTION 17:

Fill in the blanks. Select from the following phrases.

array
array[8]
int val
val
array[0]
array[ index ]
index++
:

(Hint: only some of the phrases are used.)


go to previous page   go to home page   go to next page