Printing Movie Posters

In all cases, make sure that your code would work even if the arrays changed.

1. Enter this code into java (Cutting and pasting seems wise).

public class moviePosters
   {
   public static void main (String args[])
   {
   new moviePosters ();
   }

   public moviePosters ()
   {
   String first[] = {"Sam", "Zoe", "Sigourney", "Stephen",    "Michelle", "Laz", "Wes", "Dileep",    "Joel", "Giovanni", "CCH"};
   String last[] = {"Worthington", "Saldana", "Weaver",    "Lang", "Rodriguez", "Alonzo", "Studi",    "Rao", "Moore", "Ribisi", "Pounder"};
   System.out.println ("Avatar starring....");
   
   }
   }

2. Make it so that it prints all of the names like this:

Avatar starring....
   Sam Worthington
   Zoe Saldana
   Sigourney Weaver
   Stephen Lang
   Michelle Rodriguez
   Laz Alonzo
   Wes Studi
   Dileep Rao
   Joel Moore
   Giovanni Ribisi
   CCH Pounder

3. Make it so that it prints all of the names like this:

Avatar starring....
   1. Sam Worthington
   2. Zoe Saldana
   3. Sigourney Weaver
   4. Stephen Lang
   5. Michelle Rodriguez
   6. Laz Alonzo
   7. Wes Studi
   8. Dileep Rao
   9. Joel Moore
   10. Giovanni Ribisi
   11. CCH Pounder

4. This code finds the first name that would be alphabetically first. Add it you your code.

 String min = first [0];
   for (int i = 0 ; i < first.length ; i++)
   {
   if (min.compareTo (first [i]) > 0)
   min = first [i];
   }
   System.out.println ("\nThe earliest first name is: " + min);

5. Find the last name that would be alphabetically first.

6. Find the first name that would be alphabetically last. Find the last name that would be alphabetically last.

7. (Bonus) Make it so that it prints all of the names like this:

Avatar starring....
   Sam Worthington, Zoe Saldana, Sigourney Weaver, 
   Stephen Lang, Michelle Rodriguez, Laz Alonzo, 
   Wes Studi, Dileep Rao, Joel Moore, 
   Giovanni Ribisi, CCH Pounder.