forked from Nnamdikeshi/Java2545examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathITECCourseManager.java
More file actions
37 lines (26 loc) · 1.05 KB
/
Copy pathITECCourseManager.java
File metadata and controls
37 lines (26 loc) · 1.05 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
31
32
33
34
35
36
package week6_first_classes.OOPITECCourseManager;
/**
* Class with the main method in - create and work with some ITECCourse objects
*/
public class ITECCourseManager {
public static void main(String args[]) {
ITECCourse maintenanceCourse = new ITECCourse();
maintenanceCourse.name = "Microcomputer Systems Maintenance";
maintenanceCourse.code = 1310;
maintenanceCourse.maxStudents = 20;
//Add some students.
//TODO check that we have not exceeded the max number for the class
maintenanceCourse.addStudent("Anna");
maintenanceCourse.addStudent("Bill");
maintenanceCourse.addStudent("Carl");
maintenanceCourse.writeCourseInfo();
ITECCourse datacomCourse = new ITECCourse();
datacomCourse.name = "Data Communications";
datacomCourse.code = 1425;
datacomCourse.maxStudents = 30;
datacomCourse.addStudent("Dave");
datacomCourse.addStudent("Ed");
datacomCourse.addStudent("Flora");
datacomCourse.writeCourseInfo();
}
}