Basically, I need an idea of how I can use the addModule method to add the
user's input into the module class into an array and how I can use the
removeModule method to remove it from the array.
public class Student
{
private int[] moduleArray;
private String studentName;
private String number;
private Module mod;
public Student(String name, String studentNumber)
{
moduleArray = new int[12];
studentName = name;
number = studentNumber;
}
public void addModule(Module m)
{
mod = m;
moduleArray.add(mod);
}
public void removeModule(Module m)
{
}
public class Module
{
private String moduleCode;
private String moduleTitle;
private int semester1;
private int semester2;
private int courseworkWeighting;
public Module(String code, String title, int sem1, int sem2, int
courseworkWeight)
{
moduleCode = code;
moduleTitle = title;
semester1 = sem1;
semester2 = sem2;
courseworkWeighting = courseworkWeight;
}
user's input into the module class into an array and how I can use the
removeModule method to remove it from the array.
public class Student
{
private int[] moduleArray;
private String studentName;
private String number;
private Module mod;
public Student(String name, String studentNumber)
{
moduleArray = new int[12];
studentName = name;
number = studentNumber;
}
public void addModule(Module m)
{
mod = m;
moduleArray.add(mod);
}
public void removeModule(Module m)
{
}
public class Module
{
private String moduleCode;
private String moduleTitle;
private int semester1;
private int semester2;
private int courseworkWeighting;
public Module(String code, String title, int sem1, int sem2, int
courseworkWeight)
{
moduleCode = code;
moduleTitle = title;
semester1 = sem1;
semester2 = sem2;
courseworkWeighting = courseworkWeight;
}