Student - importjava.io.*; publicclassStudentextendsPerson...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
import java.io.*;  public class Student extends Person      private int sId;               //variable to store the                                     //student ID      private int numberOfCourses;   //variable to store the number                                     //of courses      private boolean isTuitionPaid; //variable to indicate whether                                     //the tuition is paid      private Course [] coursesEnrolled; //array to store                                         //the courses      private char [] courseGrades;  //array to store the                                     //course grades        //Default constructor        //Postcondition: The instance variables are initialized.     public Student()     {         super();         numberOfCourses = 0;         sId = 0;         isTuitionPaid = false;         coursesEnrolled = new Course[6];         for (int i = 0; i < 6; i++)             coursesEnrolled[i] = new Course();         courseGrades = new char[6];         for (int i = 0; i < 6; i++)             courseGrades[i] = '*';     } 
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
      //Method to set a student's information        //Postcondition: The instance variables are set according        //               to the parameters.     public void setInfo(String fName, String lName, int ID,                         int nOfCourses, boolean isTPaid,                         Course[] courses, char[] cGrades)     {         int i;         setName(fName, lName);         //set the name         sId = ID;                      //set the student ID         isTuitionPaid = isTPaid;       //set isTuitionPaid         numberOfCourses = nOfCourses;  //set the number of courses         for (i = 0; i < numberOfCourses; i++) //set the array         {             coursesEnrolled[i].copyCourseInfo(courses[i]);             courseGrades[i] = cGrades[i];         }          sortCourses();   //sort the array coursesEnrolled     }        //Method to set a students ID        //Postcondition: sId = ID;     public void setStudentId(int ID)     {         sId = ID;     }        //Method to set whether the tuition is paid        //Postcondition: isTuitionPaid = isTPaid;     public void setIsTuitionPaid(boolean isTPaid)     { 
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 06/17/2011 for the course COMP 2301 taught by Professor Staff during the Spring '10 term at Kennesaw.

Page1 / 10

Student - importjava.io.*; publicclassStudentextendsPerson...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online