/**
*  Program declares and instantiates two 100 elements arrays; generates random numbers to fill one
*  of them; Incorrectly attempts to copy generated array into other one (two problems)
*    i. it only copies addresses
*    2  because line 45 was moved outside the block, both arrays will hold all zeroes (temp's values)
*
*/

import java.util.Random;
public class DriverSortV2
{
   
	
	public static void main(String[]args)
	{  

		Sorter sort1,sort2;
		Random rd;
		
	   int [] randomNumbers;  
		int [] temp;
		
		// instantiation of new arrays which makes all their contents 0
		temp = new int [100];
		randomNumbers = new int [100];
		
		sort1 = new Sorter();
		rd = new Random();
		
		    // print arrays to show initial contents
		System.out.println ("temp  time 1");
		for (int i = 0; i < 100; i++)
		  System.out.print ("^" + temp[i] + "^");
		System.out.println();
	    
		System.out.println ("randomNumbers");
		for (int i = 0; i < 100; i++)
		  System.out.print ("^" + randomNumbers[i] + "^");
 		System.out.println();
		 
	    
	  for(int i = 0; i < 100; i++)
	  {
	  	 randomNumbers[i] = (int)( (Math.random()*350)+1);  
    	     // randomNumbers = temp;
	  }
	         randomNumbers = temp;
	  
	       // pirnt arrays after randomNumbers has been given values
	   System.out.println ("temp time 2");
		for (int i = 0; i < 100; i++)
		  System.out.print ("^" + temp[i] + "^");
		System.out.println();
	    
		System.out.println ("randomNumbers");
		for (int i = 0; i < 100; i++)
		  System.out.print ("^" + randomNumbers[i] + "^");
 		System.out.println();

	  } // end main
}  // end class

