daily pastebin goal
58%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. NumArrayList test1;
  2.            test1 = new NumArrayList();
  3.            test1.testQuestion(); //runs test code in P1Q3
  4.            //what does it mean, testQuestion is undefined for type NumArrayList?
  5.    
  6. NumArrayList test1;
  7.            public P1Q3()
  8.            {
  9.                    test1 =  new NumArrayList();
  10.            }
  11.  
  12.  
  13.    public void testQuestion()
  14.    {
  15.            NumArrayList test1;
  16.            test1 = new NumArrayList();
  17.  
  18.            double[] a = {1,2,3,4,13.7,-29,3,101.9};
  19.            double[] b = {3,7,13,901,-29.1,0.0001};
  20.  
  21.            for(int i = 0; i < a.length; i++)
  22.            {
  23.                    test1.insert(3,a[i]);
  24.            }
  25.            for(int i = 0; i < b.length; i++)
  26.            {
  27.                    test1.insert(3,b[i]);
  28.            }
  29.  
  30.            test1.print();
  31.            System.out.println();//puts a line between.
  32.            System.out.println("Printed out test1.");
  33.            test1.insert(0,0);
  34.            System.out.println("inserted 0 into 0 in test1, check? : ");
  35.            test1.print();
  36.            System.out.println(); //line spacing.
  37.            test1.remove(test1.size());
  38.            System.out.println("removed last element, check? : ");
  39.            System.out.println();
  40.            test1.print();
  41.            System.out.println();
  42.            test1.lookup(0);//lookup to see if 0 is @ 0
  43.            test1.print();
  44.    }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top