brainfrz

Untitled

Feb 15th, 2016
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 2.36 KB | None | 0 0
  1. /**************************************************************************************************
  2.  * Program Name   : Week 3 - GPA
  3.  * Author         : Terry Weiss
  4.  * Date           : February 12, 2016
  5.  * Course/Section : CSC264 - 001
  6.  * Program Description: This class holds the information for a specific semester.
  7.  *
  8.  * Methods:
  9.  * -------
  10.  *
  11.  **************************************************************************************************/
  12.  
  13. package transcript;
  14.  
  15.  
  16. public class SemesterInfo
  17. {
  18.     public static int MAX_COURSES        = 7;    //Maximum valid number of courses in a semester
  19.     public static int MAX_CREDITS        = 18;   //Maximum valid number of credits in a semester
  20.  
  21.     protected String name;                       //Name of semester
  22.     protected String courseNumber;               //Numerical portion of the course name
  23.     protected int creditHours;                   //Running total of credits in semester
  24.     protected int courseCount;                   //Running total of courses in semester
  25.  
  26.     protected CourseInfo[] courseList;           //List of courses currently in the semester
  27.  
  28.  
  29.     /**********************************************************************************************
  30.      * Method Name    : SemesterInfo - Constructor
  31.      * Author         : Terry Weiss
  32.      * Date           : February 12, 2016
  33.      * Course/Section : CSC264 - 001
  34.      * Program Description: This builds an empty semester using the given name.
  35.      *
  36.      * BEGIN SemesterInfo
  37.      *     Assign semester name
  38.      *     Init credit hours to 0
  39.      *     Init course count to 0
  40.      *     Init empty course list to size of defined max number of courses
  41.      * END SemesterInfo
  42.      **********************************************************************************************/
  43.     SemesterInfo(String name)
  44.     {
  45.         //Local constants
  46.  
  47.         //Local variables
  48.  
  49.         /*****************************   Start CourseInfo Constructor  ****************************/
  50.  
  51.         //Assign semester name
  52.         this.name    = name;
  53.  
  54.         //Init credit hours to 0
  55.         creditHours  = 0;
  56.  
  57.         //Init course count to 0
  58.         courseCount  = 0;
  59.  
  60.         //Init course list to size of defined max number of courses
  61.         courseList   = new CourseInfo[MAX_COURSES];
  62.  
  63.     }//end SemesterInfo constructor
  64. }//end class CourseInfo
Advertisement
Add Comment
Please, Sign In to add comment