/* ITI 1121/1521. Introduction to Computer Science II * Assignment/Devoir 3 * * */ public class A5Q6 { public static Sequence zip( Operator f, Sequence l1, Sequence l2 ) { throw new UnsupportedOperationException( "Replace this statement by your answer to the question!" ); } public static void main( String[] args ) { StudentInfo.display(); Sequence l1 = new Sequence(); for ( int i=0; i<10; i++ ) { l1.add( new Integer( i ) ); } Sequence l2 = new Sequence(); for ( int i=0; i<10; i++ ) { l2.addFirst( new Integer( i ) ); } Sequence l3 = zip( new Plus(), l1, l2 ); System.out.println( "l3 = zip( plus, l1, l2 );" ); System.out.println( "l1 is " + l1 ); System.out.println( "l2 is " + l2 ); System.out.println( "l3 is " + l3 ); System.out.println(); } } // > java A5Q6 // // ************************************************************ // * * // * * // * * // * * // ************************************************************ // // l3 = zip( plus, l1, l2 ); // l1 is [0,1,2,3,4,5,6,7,8,9] // l2 is [9,8,7,6,5,4,3,2,1,0] // l3 is [9,9,9,9,9,9,9,9,9,9]