-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathLab.java
More file actions
91 lines (74 loc) · 2.09 KB
/
Lab.java
File metadata and controls
91 lines (74 loc) · 2.09 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
//import java.util.ArrayList;
import java.util.*;
// class Lab:
// Date of Lab
// TAs Present (A list/string comprising of the names of the TAs present during the lab)
// Min. Lab Duration (The min time for which the student has to be present in the lab to be marked present)
// Student[n] (An array or list where ‘n’ is the no. of students in the class) and Student[i] would be referencing to an object of a new subclass comprising of:
// Roll No (UNIQUE ID)
// Login Time
// Logout Time
class Lab {
private Date date;
//ArrayList<String> TAs;
private int minLabDuration;
ArrayList<StudentInLab> studentsInLab; // the new student class for the Lab class
public Lab(int day, int month, int year) {
this.date = new Date(day, month, year);
studentsInLab = new ArrayList<StudentInLab>();
}
public void addMinLabDuration(int min){
this.minLabDuration=min;
}
public int getminLabDuration(){
return this.minLabDuration;
}
// public void AddTA(String name) {
// this.TAs.add(name);
// }
public void studentsAttended(){
for (StudentInLab stud: studentsInLab){
System.out.println(stud.id + " " + stud.studentData.name);
}
}
public StudentInLab addStudent(String id) {
StudentInLab temp = new StudentInLab(id);
studentsInLab.add(temp);
return temp;
}
}
class StudentInLab{
String id;
//private Time inTime;
//private Time outTime;
Student studentData;
public StudentInLab( String id) {
this.id = id;
// this.inTime = inTime;
// this.outTime = outTime;
}
public void setReference(Student sref){
this.studentData=sref;
}
}
class Date {
int d;
int m;
int y;
public Date(int day, int month, int year) {
this.d = day;
this.m = month;
this.y = year;
}
}
/*class Time {
int h;
int m;
int s;
public Time(int hours, int minutes, int seconds) {
this.h = hours;
this.m = minutes;
this.s = seconds;
}
}
*/