Skip to content
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
4 changes: 4 additions & 0 deletions IndividualProject/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,7 @@ build/

### VS Code ###
.vscode/

### DS Store ###
.DS_Store
../.DS_Store
15 changes: 15 additions & 0 deletions IndividualProject/bugs.rtf
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{\rtf1\ansi\ansicpg1252\cocoartf2639
\cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;}
{\colortbl;\red255\green255\blue255;}
{\*\expandedcolortbl;;}
{\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc0\levelnfcn0\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{decimal\}.}{\leveltext\leveltemplateid1\'02\'00.;}{\levelnumbers\'01;}\fi-360\li720\lin720 }{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{hyphen\}}{\leveltext\leveltemplateid2\'01\uc0\u8259 ;}{\levelnumbers;}\fi-360\li1440\lin1440 }{\listname ;}\listid1}}
{\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}}
\margl1440\margr1440\vieww11520\viewh8400\viewkind0
\pard\tx220\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li720\fi-720\pardirnatural\partightenfactor0
\ls1\ilvl0
\f0\fs24 \cf0 {\listtext 1. }Inside Course.java\
\pard\tx940\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\li1440\fi-1440\pardirnatural\partightenfactor0
\ls1\ilvl1\cf0 {\listtext \uc0\u8259 }\
\pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0
\cf0 \
}
Binary file added IndividualProject/data.txt
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,16 +1,24 @@
package dev.coms4156.project.individualproject;

import java.io.*;

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

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

/**
* Constructs a new Course object with the given parameters. Initial count starts at 0.
* 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 +28,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 @@ -40,47 +48,39 @@ public boolean dropStudent() {
return false;
}


public String getCourseLocation() {
return this.instructorName;
}


public String getInstructorName() {
return this.courseLocation;
}


public String getCourseTimeSlot() {
return this.courseTimeSlot;
}


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


public void reassignInstructor(String newInstructorName) {
this.instructorName = newInstructorName;
}


public void reassignLocation(String newLocation) {
this.courseLocation = newLocation;
}


public void reassignTime(String newTime) {
this.courseTimeSlot = newTime;
}


public void setEnrolledStudentCount(int count) {
this.enrolledStudentCount = count;
}


public boolean isCourseFull() {
return enrollmentCapacity > enrolledStudentCount;
}
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 Down
Loading
Loading