/*
 * TODO:
 * 
 * Define a new class, "CSC148Student", a subclass of the CSCStudent class 
 * we defined earlier, and add the following private instance variables:
 * 
 * boolean hasLabs;
 * boolean isEnrolled;
 *
 * These are just two variables that uniquely distinguish a 
 * CSC148 student from just any old CSCStudent.  Make sure you define a constructor
 * for a CSC148 student (7 parameters), and use the "super" call to initialize
 * the parent class 
 *
 * Add the appropriate getter and setter methods for the new variables.
 *
 * CSC148Student is different from CSCStudent so write its own  
 * toString method.
 * 
 * Once your class is complete, define a main method inside your class
 * in which you will declare an array to store 2 CSCStudents, 2 CSC148Students,
 * 2 Strings, one Integer and one Double (Integer and Double are wrapper
 * classes for their associated primitive types).  Once you have done this, iterate
 * through the array, and print the type of the object stored in that
 * current position to screen.  
 * 
 **/

import java.lang.*;

class CSC148Student extends CSCStudent{
 
  private boolean hasLabs;
  private boolean isEnrolled;
  
  public CSC148Student(){
  }
  
  public CSC148Student(String newName, int newAge, String newSex, String SN, String gpa, boolean labs, boolean prog){
    super(newName,newAge,newSex,SN, gpa);
    hasLabs = labs;
    isEnrolled = prog;
  }


  public void setHasLabs(boolean labs){
    hasLabs = labs;
  }
  
  public boolean hasLabs() {
    return hasLabs;
  }
  
  public void setEnrolled(boolean enrolled) {
    isEnrolled = enrolled;
  }
  
  public boolean isEnrolled (){
    return isEnrolled;
  }
  
  public String toString(){
    return super.toString() + 
      hasLabs + ":" + 
      isEnrolled;
    
  }
  
  public static void main (String [] args){
   CSCStudent x = new CSCStudent();
   CSCStudent y = new CSCStudent();
   CSC148Student a = new CSC148Student();
   CSC148Student b =new  CSC148Student();
   String str1 = new String("hi");
   String str2 = new String("bye");
   Integer in = new Integer(3);
   Double db = new Double(3.0);
   
   Object [] objList = new Object[8];
   objList[0] = str2;
   objList[1] = y;   
   objList[2] = db;
   objList[3] = b;
   objList[4] = str1;
   objList[5] = x;
   objList[6] = in;
   objList[7] = a;
   
   for (int i=0; i < objList.length; i++){
   if (objList[i] instanceof CSCStudent)
     System.out.println("CSCStudent at element " + i);
   else if (objList[i] instanceof CSC148Student)
     System.out.println("CSC148Student at element " + i);
   else if(objList[i] instanceof String)
     System.out.println("String at element " + i);
   else if(objList[i] instanceof Integer)
     System.out.println("Integer at element " + i);
   else if(objList[i] instanceof Double)
     System.out.println("Double at element " + i);  
   }
  }
  
}
