Class CourseUtilities

java.lang.Object
edu.ucsb.cs156.courses.utilities.CourseUtilities

public class CourseUtilities extends Object
static utility methods for dealing with courses
  • Method Details

    • makeFormattedCourseId

      public static String makeFormattedCourseId(String subjectArea, String courseNumber)
      Given a subject area and course number, return a course id that is formatted in the precise way that course numbers are formatted in UCSB's GOLD system. That format has the subject area left justified in an 8 character field, followed by the course number right justified in a 3 character field, followed by the suffix (if any) left justified in a 2 character field. Examples: (the 1234567812312 line is there to show the spacing.)
       1234567812312
       CMPSC   130A
       CMPSC     5JA
       CMPSC    24
       
      Parameters:
      subjectArea - subject area, such as CMPSC
      courseNumber - course number, such as 130A
      Returns:
      formatted course number