-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.dart
More file actions
27 lines (21 loc) · 885 Bytes
/
Copy pathmain.dart
File metadata and controls
27 lines (21 loc) · 885 Bytes
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
import 'location.dart';
import 'cost.dart';
import 'course.dart';
import 'semester.dart';
import 'student.dart';
import 'university.dart';
void main() {
List<Course> courses = [
GeneralCourse(6),
SpecializedCourse(4),
];
Location location = Location(true);
Semester semester = Semester(courses);
Student student = Student("Melika", location, semester);
University university = University(Cost());
print("Total student cost of ${student.name} in this semester is: \$${student.totalCost(university)}");
semester.addStudentToCourse(student, "general");
print("Enrolled students in general courses ${courses[0].enrolledStudents.map((s) => s.name).join(', ')}");
semester.addStudentToCourse(student, "specialized");
print("Enrolled students in specialized course ${courses[0].enrolledStudents.map((s) => s.name).join(', ')}");
}