Initial commit

This commit is contained in:
LinlyBoi
2022-01-27 19:21:54 +02:00
commit 8e447756ac
22 changed files with 710 additions and 0 deletions

41
src/Student/Course.java Normal file
View File

@@ -0,0 +1,41 @@
package Student;
public class Course {
private String title;
private int Students;
private final int maxStudents = 10;
Student[] students = new Student[10];
int count = 0;
public String Register(Student student) {
if (count < 10) {
students[count] = student;
count++;
return "Success";
} else {
return "Course full!";
}
}
public boolean isFull()
{
if(count ==9)
return true;
else
return false;
}
public int NumberofStudents()
{
if(students[0].getName().isBlank())
return 0;
else
return count;
}
public String title()
{
return title;
}
}

30
src/Student/Student.java Normal file
View File

@@ -0,0 +1,30 @@
package Student;
public class Student
{
private String name;
private String id;
Student(String n, String Id)
{
this.name=n;
this.id=Id;
}
public String getName()
{
return name;
}
public String getId()
{
return id;
}
public void Register(Course course)
{
//To be done later
}
}