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`; }