Class Student Code Public Class Student Private String Fullname Private String Id Arraylis Q37231547

Class Student code below:
————————————
public class Student {private String fullName;private String id;ArrayList <String> courses = new ArrayList<>();public Student(String n, String i) {fullName = n;id = i;
}public void addCourse(String course){courses.add(course);}public String DropCourse(String course){String statusMessage=””;int index = -1;for(String c:courses){if(c.equals(course))index = courses.indexOf(c);}if(index !=-1){courses.remove(index);statusMessage = “The Course “+ course +” was successfullydropped for “+ fullName;}else{statusMessage = “Course “+course+” doesn’t exist in thestudent’s list!”;}return statusMessage;}public String getFullName(){return fullName;}public String toString(){String stDetails = fullName + “, “+ id ;String allCourses =””;for(int i=0;i<courses.size();i++){allCourses = allCourses + “, ” + courses.get(i);}stDetails = stDetails + allCourses;return stDetails;}}———————
Question 2: Write java application following the MVC design model. The application should consist of four classes: GUI, ContrQuestion

OR
OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.