CMPT 126 - Harbour Centre - Fall 2006
Home  
Assigned Readings  
Examples  
Labs  
Assignments  
References  
Gradebook  
 
 
  1. Create a class CreateArray that contains the following methods:
    1. The Random class can be instantiated to create an object that will generate (pseudo-)random values. Create a method randomArray:
      public static int[] randomArray(int n) { ... }

      This method should return an array filled with n randomly generated integers.

    2. Create a method sortedArray:
      public static int[] sortedArray(int n) { ... }

      This method should return an array filled with n randomly generated integers that are in increasing order.

  2. Create a text file runningtime.txt that contains answers to the following:
    1. What is the running time of the randomArray method you created above? Briefly explain why.
    2. What is the running time of the sortedArray method you created above? Briefly explain why.
  3. Create a class Alphabetize that takes the command line argument args (an array of strings) and prints the input in alphabetic order.
  4. Create a text file named time.txt. In it, indicate how long it took you to complete this lab exercise.

When you're done, create a ZIP file containing all of the files you created for this lab and submit it with the submission server.