Hong-Phuc Bui
2024-05-15 9879363a9e020c6a3c390852a986adb8d9cf7284
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#! /usr/bin/evn python
 
"""
Programm zum Berechnen den Aufwand für das Selbststudium pro Woche in einem Semester.
 
Das Semester hat 15 Woche.
Eine Doppelstunde (DS) entspricht 90 Minuten. Ein ECTS entspricht einen Aufwand von 30 Stunden.
Eine Veranstaltung (Vorlesung, Übung, Tutorium) ist 2 DS.
Die Vorlesungen in einem Semester werden in einer Text-Datei erfasst. Ein Template ist wie folgt:
 
```txt
#Name; ECTS; Veranstaltung pro Woche
Programmierung 2; 5; 2
Mathematik 2; 5; 3
```
 
Usage:
 
$python effort_semester.py Vorlesungen.txt
                 Vorlesung ECTS         V-Ü-T/Woche   Selbstudiumszeit pro Woche
          Programmierung 2 5            2              <>
              Mathematik 2 5            3              <>
--------------------------------------------------------------------------------
                                                       <>
"""
import sys
from typing import Final
 
SEMESTER_LENGTH: Final[int] = 15  # 15 Woche pro Semester
 
 
def collect_lectures_from_file(lecture_filename:str) -> list[tuple[str, float, float]]:
    # Your code here
    pass
 
 
def compute_semester_effort(lectures: list[tuple[str, float, float]]) -> list[tuple[str, float, float, float]]:
    # Your code here
    pass
 
 
def print_effort(effort: list[tuple[str, float, float, float]]) -> None:
    # Your code here
    pass
 
 
if __name__ == "__main__":
    lecture_filename = sys.argv[1]
    lectures = collect_lectures_from_file(lecture_filename)
    effort = compute_semester_effort(lectures)
    print_effort(effort)