/**
*  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. although it will cause the two references to be identical in such a way that the first element
*       will also be correct, it copies the references multiple times when it only needs to do it once.
*
*/
import java.util.Random;
public class DriverSortV5
{
   
	
	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);  
    	    temp = randomNumbers; 
	  }
	  
	       // print 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

