-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
30 lines (24 loc) · 1.15 KB
/
Main.java
File metadata and controls
30 lines (24 loc) · 1.15 KB
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
public class Main {
public static void main(String[] args) {
Schedule mySchedule = new Schedule();
Lesson math = new Lesson("M101", "Вища Математика", "08:30");
Lesson history = new Lesson("H202", "Історія України", "10:15");
Lesson programming = new Lesson("CS50", "Java Programming", "12:00");
mySchedule.addClass(math);
mySchedule.addClass(history);
mySchedule.addClass(programming);
System.out.println("=== Мій Розклад Занять ===");
mySchedule.printAllClasses();
System.out.println("\n=== Пошук заняття CS50 ===");
Lesson foundLesson = mySchedule.findClass("CS50");
if (foundLesson != null) {
System.out.println("Знайдено: " + foundLesson);
} else {
System.out.println("Заняття не знайдено.");
}
System.out.println("\n=== Видалення заняття H202 ===");
mySchedule.removeClass("H202");
System.out.println("\n=== Розклад після оновлення ===");
mySchedule.printAllClasses();
}
}