import java.util.Scanner;

public class SpyTest
{
  public static void main(String[]  args)
  {
   Scanner scan = new Scanner(System.in); 
    /**
     * Get the user to enter the names and passwords for five spies.
     * Create 5 Spy objects, store the objects in an array (of type Spy) called spies.
     * Furthermore, store their passwords in an array
     * of strings called passwords.
     * */
    
	//---------------------------------------//
       //             YOUR CODE GOES HERE       //
      //---------------------------------------//
    



     /**
     * Need to set phoenix which acts as a test of whether or not all
     * spies are present in the future
     * */
    Spy.setPhoenix(passwords);
    
    /**
     * At some other time, when all the spies are present, they'd like to learn
     * the secret. In this case, the spies creat a string consisting of the concatenation of 
     * their encoded passwords in order from the first spy to the last, and call the unveil method 
     * on this string.
     * */
    
   //Authentication
   for (int i = 0; i < 5; i++)
    {
      
      System.out.println("Spy " + i + " please enter your serial ID:");
      if (scan.nextInt() != (spies[i]).getID())
      {
        //Authentication fails for the ith spy
        System.out.println("There's a foe among friends!");
        System.out.println("Watch out for # " + i); 
        break;
      }
      else
      {
        // All spies are authenticaed
        System.out.println("Please enter your password");
        //Note that a spy's password doesn't get recorded again


       //Encode the passwords, append all spies' (encoded) passwords together in order 


	//---------------------------------------//
       //             YOUR CODE GOES HERE       //
      //---------------------------------------//

       }
     }

   /**
    * Check that the encoding of the concatenation of all 
    * five passwords equals phoenix and if there 's a mismatch, display an message 
    * indicating that the secret has been lost forever and set the Master secret to be 
    * the null string. Otherwise, call the unveilSecret method and let the 
    * masterSecret be the output of this method. 
    **/


	//---------------------------------------//
       //             YOUR CODE GOES HERE       //
      //---------------------------------------//

 }
}
