/** * The Course class provides information about a university course. * * @author John Paxton * @version September 17, 2008 */ public class Course { /** * Provides default values for all instance variables. */ Course () { } /** * Provides initial values for all instance variables. * * @param rubric - the course rubric, e.g. "CS" * @param number - the course number, e.g. 160 * @param credits - the course credits, e.g. 4 * @param instructor - the course instructor, e.g. "Paxton" */ Course (String rubric, int number, int credits, String instructor) { this.rubric = rubric; this.number = number; this.credits = credits; this.instructor = instructor; } /** * An accessor method that returns the name of the course. * @return String - the name of the course */ public String getName () { return rubric + " " + number; } /** * An accessor method that returns the instructor of the course * @return String - the instructor of the course */ public String getInstructor () { return instructor; } /** * A mutator method that changes the instructor of the course * @param newInstructor - the new instructor */ public void setInstructor (String newInstructor) { this.instructor = newInstructor; } private String rubric; // the course rubric private int number; // the course number private int credits; // the course credits private String instructor; // the course instructor }