diff --git a/.idea/dbnavigator.xml b/.idea/dbnavigator.xml new file mode 100644 index 0000000000000000000000000000000000000000..7f0b6a1ea8aa0c52dc3399005ad93aa9f1574b76 --- /dev/null +++ b/.idea/dbnavigator.xml @@ -0,0 +1,462 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="DBNavigator.Project.DataEditorManager"> + <record-view-column-sorting-type value="BY_INDEX" /> + <value-preview-text-wrapping value="true" /> + <value-preview-pinned value="false" /> + </component> + <component name="DBNavigator.Project.DataExportManager"> + <export-instructions> + <create-header value="true" /> + <friendly-headers value="false" /> + <quote-values-containing-separator value="true" /> + <quote-all-values value="false" /> + <value-separator value="" /> + <file-name value="" /> + <file-location value="" /> + <scope value="GLOBAL" /> + <destination value="FILE" /> + <format value="EXCEL" /> + <charset value="windows-1252" /> + <charset value="windows-1252" /> + </export-instructions> + </component> + <component name="DBNavigator.Project.DatabaseBrowserManager"> + <autoscroll-to-editor value="false" /> + <autoscroll-from-editor value="true" /> + <show-object-properties value="true" /> + <loaded-nodes /> + </component> + <component name="DBNavigator.Project.DatabaseFileManager"> + <open-files /> + </component> + <component name="DBNavigator.Project.EditorStateManager"> + <last-used-providers /> + </component> + <component name="DBNavigator.Project.ExecutionManager"> + <retain-sticky-names value="false" /> + </component> + <component name="DBNavigator.Project.MethodExecutionManager"> + <method-browser /> + <execution-history> + <group-entries value="true" /> + <execution-inputs /> + </execution-history> + <argument-values-cache /> + </component> + <component name="DBNavigator.Project.ObjectDependencyManager"> + <last-used-dependency-type value="INCOMING" /> + </component> + <component name="DBNavigator.Project.ObjectQuickFilterManager"> + <last-used-operator value="EQUAL" /> + <filters /> + </component> + <component name="DBNavigator.Project.ParserDiagnosticsManager"> + <diagnostics-history /> + </component> + <component name="DBNavigator.Project.ScriptExecutionManager" clear-outputs="true"> + <recently-used-interfaces /> + </component> + <component name="DBNavigator.Project.Settings"> + <connections /> + <browser-settings> + <general> + <display-mode value="TABBED" /> + <navigation-history-size value="100" /> + <show-object-details value="false" /> + </general> + <filters> + <object-type-filter> + <object-type name="SCHEMA" enabled="true" /> + <object-type name="USER" enabled="true" /> + <object-type name="ROLE" enabled="true" /> + <object-type name="PRIVILEGE" enabled="true" /> + <object-type name="CHARSET" enabled="true" /> + <object-type name="TABLE" enabled="true" /> + <object-type name="VIEW" enabled="true" /> + <object-type name="MATERIALIZED_VIEW" enabled="true" /> + <object-type name="NESTED_TABLE" enabled="true" /> + <object-type name="COLUMN" enabled="true" /> + <object-type name="INDEX" enabled="true" /> + <object-type name="CONSTRAINT" enabled="true" /> + <object-type name="DATASET_TRIGGER" enabled="true" /> + <object-type name="DATABASE_TRIGGER" enabled="true" /> + <object-type name="SYNONYM" enabled="true" /> + <object-type name="SEQUENCE" enabled="true" /> + <object-type name="PROCEDURE" enabled="true" /> + <object-type name="FUNCTION" enabled="true" /> + <object-type name="PACKAGE" enabled="true" /> + <object-type name="TYPE" enabled="true" /> + <object-type name="TYPE_ATTRIBUTE" enabled="true" /> + <object-type name="ARGUMENT" enabled="true" /> + <object-type name="DIMENSION" enabled="true" /> + <object-type name="CLUSTER" enabled="true" /> + <object-type name="DBLINK" enabled="true" /> + </object-type-filter> + </filters> + <sorting> + <object-type name="COLUMN" sorting-type="NAME" /> + <object-type name="FUNCTION" sorting-type="NAME" /> + <object-type name="PROCEDURE" sorting-type="NAME" /> + <object-type name="ARGUMENT" sorting-type="POSITION" /> + </sorting> + <default-editors> + <object-type name="VIEW" editor-type="SELECTION" /> + <object-type name="PACKAGE" editor-type="SELECTION" /> + <object-type name="TYPE" editor-type="SELECTION" /> + </default-editors> + </browser-settings> + <navigation-settings> + <lookup-filters> + <lookup-objects> + <object-type name="SCHEMA" enabled="true" /> + <object-type name="USER" enabled="false" /> + <object-type name="ROLE" enabled="false" /> + <object-type name="PRIVILEGE" enabled="false" /> + <object-type name="CHARSET" enabled="false" /> + <object-type name="TABLE" enabled="true" /> + <object-type name="VIEW" enabled="true" /> + <object-type name="MATERIALIZED VIEW" enabled="true" /> + <object-type name="INDEX" enabled="true" /> + <object-type name="CONSTRAINT" enabled="true" /> + <object-type name="DATASET TRIGGER" enabled="true" /> + <object-type name="DATABASE TRIGGER" enabled="true" /> + <object-type name="SYNONYM" enabled="false" /> + <object-type name="SEQUENCE" enabled="true" /> + <object-type name="PROCEDURE" enabled="true" /> + <object-type name="FUNCTION" enabled="true" /> + <object-type name="PACKAGE" enabled="true" /> + <object-type name="TYPE" enabled="true" /> + <object-type name="DIMENSION" enabled="false" /> + <object-type name="CLUSTER" enabled="false" /> + <object-type name="DBLINK" enabled="true" /> + </lookup-objects> + <force-database-load value="false" /> + <prompt-connection-selection value="true" /> + <prompt-schema-selection value="true" /> + </lookup-filters> + </navigation-settings> + <dataset-grid-settings> + <general> + <enable-zooming value="true" /> + <enable-column-tooltip value="true" /> + </general> + <sorting> + <nulls-first value="true" /> + <max-sorting-columns value="4" /> + </sorting> + <tracking-columns> + <columnNames value="" /> + <visible value="true" /> + <editable value="false" /> + </tracking-columns> + </dataset-grid-settings> + <dataset-editor-settings> + <text-editor-popup> + <active value="false" /> + <active-if-empty value="false" /> + <data-length-threshold value="100" /> + <popup-delay value="1000" /> + </text-editor-popup> + <values-actions-popup> + <show-popup-button value="true" /> + <element-count-threshold value="1000" /> + <data-length-threshold value="250" /> + </values-actions-popup> + <general> + <fetch-block-size value="100" /> + <fetch-timeout value="30" /> + <trim-whitespaces value="true" /> + <convert-empty-strings-to-null value="true" /> + <select-content-on-cell-edit value="true" /> + <large-value-preview-active value="true" /> + </general> + <filters> + <prompt-filter-dialog value="true" /> + <default-filter-type value="BASIC" /> + </filters> + <qualified-text-editor text-length-threshold="300"> + <content-types> + <content-type name="Text" enabled="true" /> + <content-type name="Properties" enabled="true" /> + <content-type name="XML" enabled="true" /> + <content-type name="DTD" enabled="true" /> + <content-type name="HTML" enabled="true" /> + <content-type name="XHTML" enabled="true" /> + <content-type name="Java" enabled="true" /> + <content-type name="SQL" enabled="true" /> + <content-type name="PL/SQL" enabled="true" /> + <content-type name="JSON" enabled="true" /> + <content-type name="JSON5" enabled="true" /> + <content-type name="Groovy" enabled="true" /> + <content-type name="AIDL" enabled="true" /> + <content-type name="YAML" enabled="true" /> + <content-type name="Manifest" enabled="true" /> + </content-types> + </qualified-text-editor> + <record-navigation> + <navigation-target value="VIEWER" /> + </record-navigation> + </dataset-editor-settings> + <code-editor-settings> + <general> + <show-object-navigation-gutter value="false" /> + <show-spec-declaration-navigation-gutter value="true" /> + <enable-spellchecking value="true" /> + <enable-reference-spellchecking value="false" /> + </general> + <confirmations> + <save-changes value="false" /> + <revert-changes value="true" /> + </confirmations> + </code-editor-settings> + <code-completion-settings> + <filters> + <basic-filter> + <filter-element type="RESERVED_WORD" id="keyword" selected="true" /> + <filter-element type="RESERVED_WORD" id="function" selected="true" /> + <filter-element type="RESERVED_WORD" id="parameter" selected="true" /> + <filter-element type="RESERVED_WORD" id="datatype" selected="true" /> + <filter-element type="RESERVED_WORD" id="exception" selected="true" /> + <filter-element type="OBJECT" id="schema" selected="true" /> + <filter-element type="OBJECT" id="role" selected="true" /> + <filter-element type="OBJECT" id="user" selected="true" /> + <filter-element type="OBJECT" id="privilege" selected="true" /> + <user-schema> + <filter-element type="OBJECT" id="table" selected="true" /> + <filter-element type="OBJECT" id="view" selected="true" /> + <filter-element type="OBJECT" id="materialized view" selected="true" /> + <filter-element type="OBJECT" id="index" selected="true" /> + <filter-element type="OBJECT" id="constraint" selected="true" /> + <filter-element type="OBJECT" id="trigger" selected="true" /> + <filter-element type="OBJECT" id="synonym" selected="false" /> + <filter-element type="OBJECT" id="sequence" selected="true" /> + <filter-element type="OBJECT" id="procedure" selected="true" /> + <filter-element type="OBJECT" id="function" selected="true" /> + <filter-element type="OBJECT" id="package" selected="true" /> + <filter-element type="OBJECT" id="type" selected="true" /> + <filter-element type="OBJECT" id="dimension" selected="true" /> + <filter-element type="OBJECT" id="cluster" selected="true" /> + <filter-element type="OBJECT" id="dblink" selected="true" /> + </user-schema> + <public-schema> + <filter-element type="OBJECT" id="table" selected="false" /> + <filter-element type="OBJECT" id="view" selected="false" /> + <filter-element type="OBJECT" id="materialized view" selected="false" /> + <filter-element type="OBJECT" id="index" selected="false" /> + <filter-element type="OBJECT" id="constraint" selected="false" /> + <filter-element type="OBJECT" id="trigger" selected="false" /> + <filter-element type="OBJECT" id="synonym" selected="false" /> + <filter-element type="OBJECT" id="sequence" selected="false" /> + <filter-element type="OBJECT" id="procedure" selected="false" /> + <filter-element type="OBJECT" id="function" selected="false" /> + <filter-element type="OBJECT" id="package" selected="false" /> + <filter-element type="OBJECT" id="type" selected="false" /> + <filter-element type="OBJECT" id="dimension" selected="false" /> + <filter-element type="OBJECT" id="cluster" selected="false" /> + <filter-element type="OBJECT" id="dblink" selected="false" /> + </public-schema> + <any-schema> + <filter-element type="OBJECT" id="table" selected="true" /> + <filter-element type="OBJECT" id="view" selected="true" /> + <filter-element type="OBJECT" id="materialized view" selected="true" /> + <filter-element type="OBJECT" id="index" selected="true" /> + <filter-element type="OBJECT" id="constraint" selected="true" /> + <filter-element type="OBJECT" id="trigger" selected="true" /> + <filter-element type="OBJECT" id="synonym" selected="true" /> + <filter-element type="OBJECT" id="sequence" selected="true" /> + <filter-element type="OBJECT" id="procedure" selected="true" /> + <filter-element type="OBJECT" id="function" selected="true" /> + <filter-element type="OBJECT" id="package" selected="true" /> + <filter-element type="OBJECT" id="type" selected="true" /> + <filter-element type="OBJECT" id="dimension" selected="true" /> + <filter-element type="OBJECT" id="cluster" selected="true" /> + <filter-element type="OBJECT" id="dblink" selected="true" /> + </any-schema> + </basic-filter> + <extended-filter> + <filter-element type="RESERVED_WORD" id="keyword" selected="true" /> + <filter-element type="RESERVED_WORD" id="function" selected="true" /> + <filter-element type="RESERVED_WORD" id="parameter" selected="true" /> + <filter-element type="RESERVED_WORD" id="datatype" selected="true" /> + <filter-element type="RESERVED_WORD" id="exception" selected="true" /> + <filter-element type="OBJECT" id="schema" selected="true" /> + <filter-element type="OBJECT" id="user" selected="true" /> + <filter-element type="OBJECT" id="role" selected="true" /> + <filter-element type="OBJECT" id="privilege" selected="true" /> + <user-schema> + <filter-element type="OBJECT" id="table" selected="true" /> + <filter-element type="OBJECT" id="view" selected="true" /> + <filter-element type="OBJECT" id="materialized view" selected="true" /> + <filter-element type="OBJECT" id="index" selected="true" /> + <filter-element type="OBJECT" id="constraint" selected="true" /> + <filter-element type="OBJECT" id="trigger" selected="true" /> + <filter-element type="OBJECT" id="synonym" selected="true" /> + <filter-element type="OBJECT" id="sequence" selected="true" /> + <filter-element type="OBJECT" id="procedure" selected="true" /> + <filter-element type="OBJECT" id="function" selected="true" /> + <filter-element type="OBJECT" id="package" selected="true" /> + <filter-element type="OBJECT" id="type" selected="true" /> + <filter-element type="OBJECT" id="dimension" selected="true" /> + <filter-element type="OBJECT" id="cluster" selected="true" /> + <filter-element type="OBJECT" id="dblink" selected="true" /> + </user-schema> + <public-schema> + <filter-element type="OBJECT" id="table" selected="true" /> + <filter-element type="OBJECT" id="view" selected="true" /> + <filter-element type="OBJECT" id="materialized view" selected="true" /> + <filter-element type="OBJECT" id="index" selected="true" /> + <filter-element type="OBJECT" id="constraint" selected="true" /> + <filter-element type="OBJECT" id="trigger" selected="true" /> + <filter-element type="OBJECT" id="synonym" selected="true" /> + <filter-element type="OBJECT" id="sequence" selected="true" /> + <filter-element type="OBJECT" id="procedure" selected="true" /> + <filter-element type="OBJECT" id="function" selected="true" /> + <filter-element type="OBJECT" id="package" selected="true" /> + <filter-element type="OBJECT" id="type" selected="true" /> + <filter-element type="OBJECT" id="dimension" selected="true" /> + <filter-element type="OBJECT" id="cluster" selected="true" /> + <filter-element type="OBJECT" id="dblink" selected="true" /> + </public-schema> + <any-schema> + <filter-element type="OBJECT" id="table" selected="true" /> + <filter-element type="OBJECT" id="view" selected="true" /> + <filter-element type="OBJECT" id="materialized view" selected="true" /> + <filter-element type="OBJECT" id="index" selected="true" /> + <filter-element type="OBJECT" id="constraint" selected="true" /> + <filter-element type="OBJECT" id="trigger" selected="true" /> + <filter-element type="OBJECT" id="synonym" selected="true" /> + <filter-element type="OBJECT" id="sequence" selected="true" /> + <filter-element type="OBJECT" id="procedure" selected="true" /> + <filter-element type="OBJECT" id="function" selected="true" /> + <filter-element type="OBJECT" id="package" selected="true" /> + <filter-element type="OBJECT" id="type" selected="true" /> + <filter-element type="OBJECT" id="dimension" selected="true" /> + <filter-element type="OBJECT" id="cluster" selected="true" /> + <filter-element type="OBJECT" id="dblink" selected="true" /> + </any-schema> + </extended-filter> + </filters> + <sorting enabled="true"> + <sorting-element type="RESERVED_WORD" id="keyword" /> + <sorting-element type="RESERVED_WORD" id="datatype" /> + <sorting-element type="OBJECT" id="column" /> + <sorting-element type="OBJECT" id="table" /> + <sorting-element type="OBJECT" id="view" /> + <sorting-element type="OBJECT" id="materialized view" /> + <sorting-element type="OBJECT" id="index" /> + <sorting-element type="OBJECT" id="constraint" /> + <sorting-element type="OBJECT" id="trigger" /> + <sorting-element type="OBJECT" id="synonym" /> + <sorting-element type="OBJECT" id="sequence" /> + <sorting-element type="OBJECT" id="procedure" /> + <sorting-element type="OBJECT" id="function" /> + <sorting-element type="OBJECT" id="package" /> + <sorting-element type="OBJECT" id="type" /> + <sorting-element type="OBJECT" id="dimension" /> + <sorting-element type="OBJECT" id="cluster" /> + <sorting-element type="OBJECT" id="dblink" /> + <sorting-element type="OBJECT" id="schema" /> + <sorting-element type="OBJECT" id="role" /> + <sorting-element type="OBJECT" id="user" /> + <sorting-element type="RESERVED_WORD" id="function" /> + <sorting-element type="RESERVED_WORD" id="parameter" /> + </sorting> + <format> + <enforce-code-style-case value="true" /> + </format> + </code-completion-settings> + <execution-engine-settings> + <statement-execution> + <fetch-block-size value="100" /> + <execution-timeout value="20" /> + <debug-execution-timeout value="600" /> + <focus-result value="false" /> + <prompt-execution value="false" /> + </statement-execution> + <script-execution> + <command-line-interfaces /> + <execution-timeout value="300" /> + </script-execution> + <method-execution> + <execution-timeout value="30" /> + <debug-execution-timeout value="600" /> + <parameter-history-size value="10" /> + </method-execution> + </execution-engine-settings> + <operation-settings> + <transactions> + <uncommitted-changes> + <on-project-close value="ASK" /> + <on-disconnect value="ASK" /> + <on-autocommit-toggle value="ASK" /> + </uncommitted-changes> + <multiple-uncommitted-changes> + <on-commit value="ASK" /> + <on-rollback value="ASK" /> + </multiple-uncommitted-changes> + </transactions> + <session-browser> + <disconnect-session value="ASK" /> + <kill-session value="ASK" /> + <reload-on-filter-change value="false" /> + </session-browser> + <compiler> + <compile-type value="KEEP" /> + <compile-dependencies value="ASK" /> + <always-show-controls value="false" /> + </compiler> + <debugger> + <debugger-type value="ASK" /> + <use-generic-runners value="true" /> + </debugger> + </operation-settings> + <ddl-file-settings> + <extensions> + <mapping file-type-id="VIEW" extensions="vw" /> + <mapping file-type-id="TRIGGER" extensions="trg" /> + <mapping file-type-id="PROCEDURE" extensions="prc" /> + <mapping file-type-id="FUNCTION" extensions="fnc" /> + <mapping file-type-id="PACKAGE" extensions="pkg" /> + <mapping file-type-id="PACKAGE_SPEC" extensions="pks" /> + <mapping file-type-id="PACKAGE_BODY" extensions="pkb" /> + <mapping file-type-id="TYPE" extensions="tpe" /> + <mapping file-type-id="TYPE_SPEC" extensions="tps" /> + <mapping file-type-id="TYPE_BODY" extensions="tpb" /> + </extensions> + <general> + <lookup-ddl-files value="true" /> + <create-ddl-files value="false" /> + <synchronize-ddl-files value="true" /> + <use-qualified-names value="false" /> + <make-scripts-rerunnable value="true" /> + </general> + </ddl-file-settings> + <general-settings> + <regional-settings> + <date-format value="MEDIUM" /> + <number-format value="UNGROUPED" /> + <locale value="SYSTEM_DEFAULT" /> + <use-custom-formats value="false" /> + </regional-settings> + <environment> + <environment-types> + <environment-type id="development" name="Development" description="Development environment" color="-2430209/-12296320" readonly-code="false" readonly-data="false" /> + <environment-type id="integration" name="Integration" description="Integration environment" color="-2621494/-12163514" readonly-code="true" readonly-data="false" /> + <environment-type id="production" name="Production" description="Productive environment" color="-11574/-10271420" readonly-code="true" readonly-data="true" /> + <environment-type id="other" name="Other" description="" color="-1576/-10724543" readonly-code="false" readonly-data="false" /> + </environment-types> + <visibility-settings> + <connection-tabs value="true" /> + <dialog-headers value="true" /> + <object-editor-tabs value="true" /> + <script-editor-tabs value="false" /> + <execution-result-tabs value="true" /> + </visibility-settings> + </environment> + </general-settings> + </component> + <component name="DBNavigator.Project.StatementExecutionManager"> + <execution-variables /> + </component> +</project> \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000000000000000000000000000000000000..635b3d530fc0cc29c17c7bd27cb458fea3482d26 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="4"> + <component name="ProjectModuleManager"> + <modules> + <module fileurl="file://$PROJECT_DIR$/notenmanager.iml" filepath="$PROJECT_DIR$/notenmanager.iml" /> + </modules> + </component> +</project> \ No newline at end of file diff --git a/notenmanager.iml b/notenmanager.iml new file mode 100644 index 0000000000000000000000000000000000000000..c90834f2d607afe55e6104d8aa2cdfffb713f688 --- /dev/null +++ b/notenmanager.iml @@ -0,0 +1,11 @@ +<?xml version="1.0" encoding="UTF-8"?> +<module type="JAVA_MODULE" version="4"> + <component name="NewModuleRootManager" inherit-compiler-output="true"> + <exclude-output /> + <content url="file://$MODULE_DIR$"> + <sourceFolder url="file://$MODULE_DIR$/src" isTestSource="false" /> + </content> + <orderEntry type="inheritedJdk" /> + <orderEntry type="sourceFolder" forTests="false" /> + </component> +</module> \ No newline at end of file diff --git a/src/Calcuable.java b/src/Calcuable.java new file mode 100644 index 0000000000000000000000000000000000000000..4af953b81eb3d7291f1a97ec3acb91151cddd92f --- /dev/null +++ b/src/Calcuable.java @@ -0,0 +1,6 @@ +public interface Calcuable +{ + double calculateAverage(); + int calculateMedian(); //Wird vielleicht spaeter benoetigt + double calculateModus(); +} diff --git a/src/Course.java b/src/Course.java new file mode 100644 index 0000000000000000000000000000000000000000..119fad31a0c4f7d14de26eee9f8415fef36688f0 --- /dev/null +++ b/src/Course.java @@ -0,0 +1,43 @@ +import enumeration.BachelorSemester; +import enumeration.CourseType; +import enumeration.ExamType; +import enumeration.Mark; + +public class Course +{ + // most attributes are concrete and can't be changed easily without changing the whole system + private final int id; // PK // FK + private final String name; + private final BachelorSemester bachelorSemester; + private final CourseType courseType; + private final int sws; + private final double ects; + private ExamType examType; + + public Course(int id, String name, BachelorSemester bachelorSemester, CourseType courseType, int sws, double ects, ExamType examType) + { + this.id = id; + this.name = name; + this.bachelorSemester = bachelorSemester; + this.courseType = courseType; + this.sws = sws; + this.ects = ects; + this.examType = examType; + } + + public int getId(){ + return id; + } + + @Override + public String toString() { + return "\nCourse: " + + "id=" + id + + ", name='" + name + '\'' + + ", bachelorSemester=" + bachelorSemester + + ", courseType=" + courseType + + ", sws=" + sws + + ", ects=" + ects + + ", examType=" + examType; + } +} diff --git a/src/CoursesOfStudy.java b/src/CoursesOfStudy.java new file mode 100644 index 0000000000000000000000000000000000000000..26e437e2351da421e0205d9433ef3d8a8e414ba3 --- /dev/null +++ b/src/CoursesOfStudy.java @@ -0,0 +1,26 @@ +import enumeration.BachelorDegree; +import enumeration.FieldOfStudy; + +import java.util.List; + +public class CoursesOfStudy +{ + private final int id; + private final String name; + private final BachelorDegree bachelorDegree; + private final int duration; + private final int fees; + private final List<Course> courses; + private FieldOfStudy fieldOfStudy; + + public CoursesOfStudy(int id, String name, BachelorDegree bachelorDegree, int duration, int fees, List<Course> courses, FieldOfStudy fieldOfStudy) + { + this.id = id; + this.name = name; + this.bachelorDegree = bachelorDegree; + this.duration = duration; + this.fees = fees; + this.courses = courses; + this.fieldOfStudy = fieldOfStudy; + } +} diff --git a/src/Enrollment.java b/src/Enrollment.java new file mode 100644 index 0000000000000000000000000000000000000000..7abf153076802626da6212615229aaed4e564a73 --- /dev/null +++ b/src/Enrollment.java @@ -0,0 +1,15 @@ +public class Enrollment +{ + private final int id; + private final int studentID; + private final int lecturerID; + private final int courseID; + + public Enrollment(int id, int studentID, int lecturerID, int courseID) + { + this.id = id; + this.studentID = studentID; + this.lecturerID = lecturerID; + this.courseID = courseID; + } +} diff --git a/src/Lecturer.java b/src/Lecturer.java new file mode 100644 index 0000000000000000000000000000000000000000..176cc8f681d0f90fa1ee3bcd8b0a876410281bdc --- /dev/null +++ b/src/Lecturer.java @@ -0,0 +1,22 @@ +import enumeration.Gender; +import enumeration.Mark; +import enumeration.Status; + +import java.util.List; + +public class Lecturer extends UniversityMember { + public Lecturer(int id, String firstName, String lastName, String placeOfResidence, String birthPlace, + String officialEmail, String privateEmail, List<Course> personalCourses, Gender gender, Status status) { + super(id, gender, firstName, lastName, placeOfResidence, birthPlace, + officialEmail, privateEmail, personalCourses); + } + + public boolean rateStudent(Student student, Course course, Mark mark) { + if (isSignedUpForCourse(course)) { + return student.setGrade(course, mark); + } + return false; + } + + +} diff --git a/src/Main.java b/src/Main.java new file mode 100644 index 0000000000000000000000000000000000000000..4e1145b6406d321ceac06098439fa8e8a3ef8954 --- /dev/null +++ b/src/Main.java @@ -0,0 +1,46 @@ +import enumeration.*; + +import java.util.ArrayList; +import java.util.List; + +public class Main { + public static void main(String[] args) { + + + List<Course> kevCourses = new ArrayList<>(); + + Course a1 = new Course(1, "test1", BachelorSemester.FIFTH, CourseType.COMPULSORY, 5, 5.5, ExamType.ASSIGNMENT); + Course a2 = new Course(2, "test2", BachelorSemester.FIFTH, CourseType.COMPULSORY, 5, 5.5, ExamType.ASSIGNMENT); + Course a3 = new Course(3, "test3", BachelorSemester.FIFTH, CourseType.COMPULSORY, 5, 5.5, ExamType.ASSIGNMENT); + Course a4 = new Course(4, "test4", BachelorSemester.FIFTH, CourseType.COMPULSORY, 5, 5.5, ExamType.ASSIGNMENT); + Course a5 = new Course(4, "test4", BachelorSemester.FIFTH, CourseType.COMPULSORY, 5, 5.5, ExamType.ASSIGNMENT); + Course a6 = new Course(4, "test4", BachelorSemester.FIFTH, CourseType.COMPULSORY, 5, 5.5, ExamType.ASSIGNMENT); + Course a7 = new Course(4, "test4", BachelorSemester.FIFTH, CourseType.COMPULSORY, 5, 5.5, ExamType.ASSIGNMENT); + + kevCourses.add(a1); + kevCourses.add(a2); + kevCourses.add(a3); + kevCourses.add(a4); + kevCourses.add(a5); + kevCourses.add(a6); + kevCourses.add(a7); + + Student kev = new Student(1, Gender.MALE, "Kevin", + "Thaller", "Tittling", "Freyung", "kevin.thaller@stud.th-deg.de", + "123", kevCourses, Status.ENROLLED, BachelorSemester.FIFTH); + + + kev.setGrade(a1, Mark.VIER_NULL); + kev.setGrade(a2, Mark.FUENF_NULL); + kev.setGrade(a3, Mark.DREI_DREI); + kev.setGrade(a4, Mark.EINS_NULL); + kev.setGrade(a5, Mark.EINS_NULL); + kev.setGrade(a6, Mark.FUENF_NULL); + kev.setGrade(a7, Mark.FUENF_NULL); + + System.out.println(kev.getGrades()); + System.out.println(kev.calculateAverage()); + System.out.println(kev.calculateMedian()); + + } +} \ No newline at end of file diff --git a/src/Student.java b/src/Student.java new file mode 100644 index 0000000000000000000000000000000000000000..ae75dc92ab742c8d49effb72fda4d2e3cf7d5006 --- /dev/null +++ b/src/Student.java @@ -0,0 +1,92 @@ +import enumeration.BachelorSemester; +import enumeration.Gender; +import enumeration.Mark; +import enumeration.Status; + +import java.util.*; + +public class Student extends UniversityMember implements Calcuable { + // no static because variables don't make any sense without the created object + private Status status; + private boolean paidFees; + private BachelorSemester bachelorSemester; + private Map<Course, Mark> grades = new HashMap<>(); + + + public Student(int id, Gender gender, String firstName, String lastName, String placeOfResidence, String birthPlace, + String officialEmail, String privateEmail, List<Course> personalCourses, + Status status, BachelorSemester bachelorSemester) { + super(id, gender, firstName, lastName, placeOfResidence, birthPlace, + officialEmail, privateEmail, personalCourses); + this.status = status; + this.paidFees = true; + this.bachelorSemester = bachelorSemester; + this.initGrades(); + } + + private void initGrades() { + for (Course course : this.getPersonalCourses()) { + grades.put(course, null); + } + } + + public boolean setGrade(Course course, Mark mark) { + if (isSignedUpForCourse(course)) { + grades.replace(course, mark); + return true; + } + return false; + } + + + public Map<Course, Mark> getGrades() { + return grades; + } + + + public boolean increaseSemester() { + if (paidFees) { + bachelorSemester.increaseSemester(); + return true; + } else { + return false; + } + } + + + @Override + public double calculateAverage() { + double average = 0.0; + int counter = 0; + for (Map.Entry<Course, Mark> grade : grades.entrySet()) { + if (grade.getValue() != null) { + Mark temp = grade.getValue(); + average += temp.getValue(); + counter++; + } + } + return average / counter; + } + + @Override + public int calculateMedian() { + List<Mark> markList = new ArrayList<>(); + int median = 0; + for (Map.Entry<Course, Mark> grade : grades.entrySet()) { + if (grade.getValue() != null) { + markList.add(grade.getValue()); + } + } + markList.sort(Comparator.comparing(Mark::getValue)); + median = (int) markList.get(markList.size() / 2).getValue(); + if (markList.size() % 2 == 0) + median = (int) ((median + markList.get(markList.size() / 2 - 1).getValue()) / 2); + return median; + } + + @Override + public double calculateModus() { + return 0.0; + } + +} \ No newline at end of file diff --git a/src/UniversityMember.java b/src/UniversityMember.java new file mode 100644 index 0000000000000000000000000000000000000000..05d3e012bb23544e6cf0a859355b80d6b56860c0 --- /dev/null +++ b/src/UniversityMember.java @@ -0,0 +1,68 @@ +import enumeration.Gender; + +import java.util.ArrayList; +import java.util.List; + +public abstract class UniversityMember { + // final for the ID because it will remain the same for the whole duration of studying or being employed + // PK & FK + private final int id; + private Gender gender; + private String firstName; + private String lastName; + private String placeOfResidence; + private final String birthPlace; + private String officialEmail; + private String privateEmail; + private List<Course> personalCourses = new ArrayList<>(); + + + public UniversityMember(int id, Gender gender, String firstName, String lastName, String placeOfResidence, String birthPlace, + String officialEmail, String privateEmail, List<Course> personalCourses) { + this.id = id; + this.gender = gender; + this.firstName = firstName; + this.lastName = lastName; + this.placeOfResidence = placeOfResidence; + this.birthPlace = birthPlace; + this.officialEmail = officialEmail; + this.privateEmail = privateEmail; + this.personalCourses = personalCourses; + } + + public Course getCourseForId(int id) { + for (Course course : personalCourses) { + if (course.getId() == id) { + return course; + } + } + return null; + } + + public List<Course> getPersonalCourses() { + return personalCourses; + } + + public boolean signUpForCourse(Course course) { + if (isSignedUpForCourse(course)) { + return false; + } else { + return personalCourses.add(course); + } + + } + + public boolean leaveCourse(Course course) { + if (isSignedUpForCourse(course)) { + return personalCourses.remove(course); + } else { + return false; + } + + } + + public boolean isSignedUpForCourse(Course course) { + return personalCourses.contains(course); + } + +} diff --git a/src/enumeration/BachelorDegree.java b/src/enumeration/BachelorDegree.java new file mode 100644 index 0000000000000000000000000000000000000000..871129afb7a1d124da768b4c4c5e12587de4cfbd --- /dev/null +++ b/src/enumeration/BachelorDegree.java @@ -0,0 +1,15 @@ +package enumeration; + +public enum BachelorDegree +{ + BACHELOR_OF_SCIENCE("B. Sc."), + BACHELOR_OF_ENGINEERING("B. Eng."), + BACHELOR_OF_ARTS("B. A."); + + private String degree; + + private BachelorDegree(String degree) + { + this.degree = degree; + } +} diff --git a/src/enumeration/BachelorSemester.java b/src/enumeration/BachelorSemester.java new file mode 100644 index 0000000000000000000000000000000000000000..92c4042a0fe57dcc66d367025af10f78fec469fe --- /dev/null +++ b/src/enumeration/BachelorSemester.java @@ -0,0 +1,25 @@ +package enumeration; + +public enum BachelorSemester +{ + FIRST(1), + SECOND(2), + THIRD(3), + FOURTH(4), + FIFTH(5), + SIXTH(6), + SEVENTH(7); + + private int semester; + + //Max-Grenze festlegen + + private BachelorSemester(int semester) + { + this.semester = semester; + } + + public void increaseSemester(){ + this.semester++; + } +} diff --git a/src/enumeration/CourseType.java b/src/enumeration/CourseType.java new file mode 100644 index 0000000000000000000000000000000000000000..159de6016fb27e329e5b68eecf08a5e2e387d6c9 --- /dev/null +++ b/src/enumeration/CourseType.java @@ -0,0 +1,16 @@ +package enumeration; + +public enum CourseType +{ + REQUIRED("required"), + ELECTIVE("AWP"), + COMPULSORY("FWP"), + PLV("PLV"); + + private String courseType; + + private CourseType(String courseType) + { + this.courseType = courseType; + } +} diff --git a/src/enumeration/ExamType.java b/src/enumeration/ExamType.java new file mode 100644 index 0000000000000000000000000000000000000000..4dbbc0bc7a9163895b0d28497495da194b745031 --- /dev/null +++ b/src/enumeration/ExamType.java @@ -0,0 +1,18 @@ +package enumeration; + +public enum ExamType +{ + WRITTEN("written ex."), + RESEARCH_PROJECT("written student research project"), + BACHELOR_THESIS("bachelor thesis"), + ORAL("oral ex."), + ASSIGNMENT("assignment"), + PERFORMANCE_RECORD("TN"); + + private String examType; + + private ExamType(String examType) + { + this.examType = examType; + } +} diff --git a/src/enumeration/FieldOfStudy.java b/src/enumeration/FieldOfStudy.java new file mode 100644 index 0000000000000000000000000000000000000000..b879936b991c68c5fb47d69c4156c6a1c0e6df58 --- /dev/null +++ b/src/enumeration/FieldOfStudy.java @@ -0,0 +1,7 @@ +package enumeration; + +public enum FieldOfStudy +{ + EMBEDDED_SYSTEMS, + MOBILE_AND_SPATIAL_SYSTEMS; +} diff --git a/src/enumeration/Gender.java b/src/enumeration/Gender.java new file mode 100644 index 0000000000000000000000000000000000000000..fc60740e6dabfca0d59e4ec0457513f4ce8376c3 --- /dev/null +++ b/src/enumeration/Gender.java @@ -0,0 +1,15 @@ +package enumeration; + +public enum Gender +{ + MALE("Male"), + FEMALE("Female"), + OTHER("Other"); + + private String gender; + + private Gender(String gender) + { + this.gender = gender; + } +} diff --git a/src/enumeration/Mark.java b/src/enumeration/Mark.java new file mode 100644 index 0000000000000000000000000000000000000000..b958727c9058ac48d5a88a6b728ac1f90191466c --- /dev/null +++ b/src/enumeration/Mark.java @@ -0,0 +1,26 @@ +package enumeration; + +public enum Mark { + EINS_NULL(1.0), + EINS_DREI(1.3), + EINS_SIEBEN(1.7), + ZWEI_NULL(2.0), + ZWEI_DREI(2.3), + ZWEI_SIEBEN(2.7), + DREI_NULL(3.0), + DREI_DREI(3.3), + DREI_SIEBEN(3.7), + VIER_NULL(4.0), + FUENF_NULL(5.0); + + + private double mark; + + private Mark(double mark) { + this.mark = mark; + } + + public double getValue() { + return mark; + } +} diff --git a/src/enumeration/Status.java b/src/enumeration/Status.java new file mode 100644 index 0000000000000000000000000000000000000000..1c8e41cfa21bf7e7f86128067866d8c2f7485b69 --- /dev/null +++ b/src/enumeration/Status.java @@ -0,0 +1,15 @@ +package enumeration; + +public enum Status +{ + ENROLLED("enrolled"), + WITHDRAWAL("withdrawing"), + DISMISSAL("dismissed"); + + private String status; + + private Status(String status) + { + this.status = status; + } +}