Class Course

java.lang.Object
edu.pdx.cs410J.junit.Course

public class Course extends Object
This class represent a course taught at a university.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Course(String department, int number, int credits)
    Creates a new Course with a given name, taught in a given department, and for a given number of credits
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the number of credits that this course is worth
    Returns the department that offers this course
    int
    Returns the number of this course
    void
    setCredits(int credits)
    Sets the number of credits that this course is worth

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Course

      public Course(String department, int number, int credits)
      Creates a new Course with a given name, taught in a given department, and for a given number of credits
      Throws:
      IllegalArgumentException - number is less than 100 or credits is less than 0
  • Method Details

    • setCredits

      public void setCredits(int credits)
      Sets the number of credits that this course is worth
    • getCredits

      public int getCredits()
      Returns the number of credits that this course is worth
    • getDepartment

      Returns the department that offers this course
    • getNumber

      public int getNumber()
      Returns the number of this course