Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up initial checkstyle warnings #46

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,16 +1,22 @@
package dev.coms4156.project.individualproject;

import java.io.*;

import java.io.Serial;
import java.io.Serializable;

/**
* Represents a course within a department.
* This class stores information about the course, including its location, time slot,
* the instructor name, enrollment count and capacity.
*/
public class Course implements Serializable {

/**
* Constructs a new Course object with the given parameters. Initial count starts at 0.
*
* @param instructorName The name of the instructor teaching the course.
* @param courseLocation The location where the course is held.
* @param timeSlot The time slot of the course.
* @param capacity The maximum number of students that can enroll in the course.
* @param instructorName The name of the instructor teaching the course.
* @param courseLocation The location where the course is held.
* @param timeSlot The time slot of the course.
* @param capacity The maximum number of students that can enroll in the course.
*/
public Course(String instructorName, String courseLocation, String timeSlot, int capacity) {
this.courseLocation = courseLocation;
Expand All @@ -20,17 +26,17 @@ public Course(String instructorName, String courseLocation, String timeSlot, int
this.enrolledStudentCount = 500;
}

/**
/**
* Enrolls a student in the course if there is space available.
*
* @return true if the student is successfully enrolled, false otherwise.
*/
public boolean enrollStudent() {
enrolledStudentCount++;
enrolledStudentCount++;
return false;
}

/**
/**
* Drops a student from the course if a student is enrolled.
*
* @return true if the student is successfully dropped, false otherwise.
Expand All @@ -57,7 +63,8 @@ public String getCourseTimeSlot() {


public String toString() {
return "\nInstructor: " + instructorName + "; Location: " + courseLocation + "; Time: " + courseTimeSlot;
return "\nInstructor: " + instructorName + "; Location: " + courseLocation + "; Time: "
+ courseTimeSlot;
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package dev.coms4156.project.individualproject;

import java.io.*;
import java.util.*;
import java.io.Serial;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;


/**
Expand All @@ -14,10 +16,10 @@ public class Department implements Serializable {
/**
* Constructs a new Department object with the given parameters.
*
* @param deptCode The code of the department.
* @param courses A HashMap containing courses offered by the department.
* @param departmentChair The name of the department chair.
* @param numberOfMajors The number of majors in the department.
* @param deptCode The code of the department.
* @param courses A HashMap containing courses offered by the department.
* @param departmentChair The name of the department chair.
* @param numberOfMajors The number of majors in the department.
*/
public Department(String deptCode, HashMap<String, Course> courses, String departmentChair,
int numberOfMajors) {
Expand Down Expand Up @@ -81,11 +83,11 @@ public void addCourse(String courseId, Course course) {
/**
* Creates and adds a new course to the department's course selection.
*
* @param courseId The ID of the new course.
* @param instructorName The name of the instructor teaching the course.
* @param courseLocation The location where the course is held.
* @param courseTimeSlot The time slot of the course.
* @param capacity The maximum number of students that can enroll in the course.
* @param courseId The ID of the new course.
* @param instructorName The name of the instructor teaching the course.
* @param courseLocation The location where the course is held.
* @param courseTimeSlot The time slot of the course.
* @param capacity The maximum number of students that can enroll in the course.
*/
public void createCourse(String courseId, String instructorName, String courseLocation,
String courseTimeSlot, int capacity) {
Expand Down
Loading
Loading