/** * Author: Josiah Yoder et al. * User: yoder * Class: SE1011-011 * Lesson: Week 9, Day 3 */ import java.util.ArrayList; import java.util.Scanner; public class Example011_10_1 { public static void main(String[] ignored) { // Arrays // Lines up side-by-side with ArrayLists below Complex011_10_1[] complexArray; complexArray = new Complex011_10_1[5]; complexArray[0] = new Complex011_10_1(1,2); for(int i=0; i complexArrayList; complexArrayList = new ArrayList(); //complexArrayList.set(0, // new Complex011_10_1(1,2)); complexArrayList.add( new Complex011_10_1(1,2)); complexArrayList.remove(0); for(int i=0; i 0.00001 // Solution: Thanks to the class for help in writing this double real; double imag; Scanner in = new Scanner(System.in); ArrayList list1 = new ArrayList(); do { System.out.println("Enter the real component: "); real = in.nextDouble(); System.out.println("Enter the imaginary component: "); imag = in.nextDouble(); if( real != 0 || imag != 0 ){ list1.add(new Complex011_10_1(real, imag)); } } while (real !=0 || imag !=0); ArrayList list2 = list1; // Draw what this looks like in memory } }