title: Java calling an object into an arraylist of another class
body: <p>Okay, before anything, I would like to mention that this is for school so please DO NOT write any code that fixes my code as that will not teach me anything.  Instead what I am looking for is references, explanations and proper terminologies if I use incorrect terminology.</p>
  
  <p>So I am having a few issues here.  Here is what I need to do,</p>
  
  <p>*Include the following methods in the Student class:
  a.  an accessor (i.e., getter) for each instance variable from part B1
  b.  a mutator (i.e., setter) for each instance variable from part B1</p>
  
  <p>Note: All access and change to the instance variables of the Student class should be through accessor and mutator methods.</p>
  
  <p>c.  constructor using all of the input parameters
  d.  print() to print specific student data (e.g., student ID, first name, last name) using accessors (i.e., getters)</p>
  
  <p>Create a student Roster class with the following methods that contain all ArrayList method calls:
  a.  public static void remove(String studentID) that removes students from the roster by student ID</p>
  
  <p>Note: If the student ID doesn’t exist, the method should print an error message indicating that it is not found.</p>
  
  <p>b.  public static void print_all() that prints a complete tab-separated list of student data using accessor methods</p>
  
  <p>Note: Tabs can be formatted as such: 1 [tab] First Name: John [tab] Last Name: Smith [tab] Age: 20 [tab] Grades: {88, 79, 59}. The print_all() method should loop through all the students in the student array list and call the print() method for each student.</p>
  
  <p>c.  public static void print_average_grade(String studentID) that correctly prints a student’s average grade by student ID
  d.  public static void print_invalid_emails() that verifies student e-mail addresses and displays all invalid e-mail addresses to the use*</p>
  
  <p>That above is where I am having trouble,  The arraylist, the constructor and calling the Student class in the Roster class.</p>
  
  <p>here is my code.</p>
  
  <p><strong>Student Class</strong></p>
  
  <pre><code> /**
    * Write a description of class Student here.
    * 
    * @author (Richard Talcik) 
    * @version (v1 3/5/17)
    */
   public class Student {
    // initialize instance variables
    private String csFirstName;  //I am using cs infront of the name because this is a class variable and a string
    private String csLastName;
    private String csEmail;
    private int ciAge;
    private int ciStudentID;
    private int[] ciaGrades;   //cia for class, integer, array;
  
    public Student(String sFirstName, String sLastName, String sEmail, int iAge, int iStudentID, String[] grades) {
  
      //doing the consturctor
      this.setFirstName(sFirstName);
      this.setLastName(sLastName); 
      this.setEmail(sEmail); 
      this.setAge(iAge);
      this.setStudentID(iStudentID);
      this.setGrades(grades);
  
  
  } 
    /**he methods to get and then followed by set
   */
  public String getFirstName()
  {
      // put your code here
      return csFirstName; //returning the value of the first name when called.
  
  }
   public String getLastName()
  {
      // put your code here
      return csLastName;
  
  }
   public String getEmail()
  {
      // put your code here
      return csEmail;
  
  }
   public int getStudentID()
  {
      // put your code here
      return ciStudentID;
  
  }
   public int getAge()
  {
      // put your code here
      return ciAge;
  
  }
   public int[] getGrades()
  {
      // put your code here
      return ciaGrades;
  
  }
  
  // calling the sets from here on out
   public void setFirstName(String newFirstName)
  {
      // put your code here
      csFirstName = newFirstName;
      //setting it
  
  }
  public void setLastName(String newLastName)
  {
      // put your code here
      csLastName = newLastName;
      //setting it
  
  }
  public void setEmail(String newEmail)
  {
      // put your code here
      csEmail = newEmail;
      //setting it
  
  }
  public void setAge(int newAge)
  {
      // put your code here
      ciAge = newAge;
      //setting it
  
  }
  public void setStudentID(int newStudentID)
  {
      // put your code here
      ciStudentID = newStudentID;
      //setting it
  
  }
  public void setGrades(int[] newGrades)
  {
      // put your code here
      ciaGrades = newGrades;
      //setting it
  
   }
  }
  </code></pre>
  
  <p>This roster class is asking me to add arguments when I call Student stu = new Student();  But I don't understand what arguments to add into there?
  I also dont really understand how I am going to incorporate my arraylist to add my <em>methods</em> in there from the student class? (<em>sorry if i used wrong terminology, please correct me if needed</em>)    </p>
  
  <p><strong>Roster Class</strong></p>
  
  <pre><code>import java.util.ArrayList;
  
   /**
    * Write a description of class Roster here.
    * 
    * @author (Richard Talcik) 
    * @version (v1)
    */
   public class Roster {
  
  
  
  
  // instance variables - replace the example below with your own
  
  
  /**
   * Constructor for objects of class Roster
   */
   public static void main(String args[]) {
      Student stu = new Student("John", "Smith", "John1989@gmail.com", 20, 1, Grades[1]);
      ArrayList&lt;Student&gt; myRoster = new ArrayList&lt;Student&gt;();
      myRoster.add(new Student("Suzan", "Erickson","Erickson_1990@gmailcom", 19, 2, [91,72,85]));
  
   }
   public static void remove(String studentID)
  {
      // put your code here
  
  }
  
  public static void print_all()
  {
      //do something
  }
  public static void print_average_grade(String studentID)
  {
      //do something
  }
  
  public static void print_invalid_emails()
  {
      //do something
  }
  
  
  }
  </code></pre>
  
  <p>please any tutorials that will help explain this will be well worth it. </p>
  
  <p>Also, I work third shift and my school is fully online.  My mentor isn't or tutor isn't available during the hours that I am awake and emails are not really best method of communication as it takes days for a response.</p>