Hong-Phuc Bui
2025-01-16 2889de7f0c2d587a17fbd322af57c29e84238620
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
export function Lecture (name, ects, sws) {
    this.name = name;
    this.ects = ects;
    this.sws = sws;
}
 
Lecture.prototype.effortPerWeek = function(weeks=15) {
    const ECTS_COST = 30;     // Wieviel Aufwand in Zeitstunden für einen ECST-Punkt
    const DS_LENGTH = 1.5;    // Stunden pro Doppelstunden
    let timeOfEcts = this.ects * ECTS_COST;
    let sumTimePerWeek = timeOfEcts / weeks;
    let lectureTimePerWeek = DS_LENGTH * (this.sws/2);
    return sumTimePerWeek - lectureTimePerWeek;
}
 
Lecture.prototype.toString = function() {
    return `${this._name}|${this.ects} ECTS|${this.sws} SWS`;
}