Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Solution {
- public static class Student {
- private String name;
- private String id;
- private String group;
- private String email;
- Student() {
- this.name = "Student";
- this.id = "000";
- this.group = "K62CB";
- this.email = "uet@vnu.edu.vn";
- }
- Student(String initName, String initID, String initEmail) {
- this.name = initName;
- this.id = initID;
- this.group = "K62CB";
- this.email = initEmail;
- }
- Student(Student s) {
- this.name = s.name;
- this.id = s.id;
- this.group = s.group;
- this.email = s.email;
- }
- Student(String initName, String initID, String initGroup, String initEmail) {
- this.name = initName;
- this.id = initID;
- this.group = initGroup;
- this.email = initEmail;
- }
- public String getName() {
- return this.name;
- }
- public void setName(String nameValue) {
- this.name = nameValue;
- }
- public String getInfo() {
- return this.name + " - " + this.id + " - " + this.group + " - " + this.email;
- }
- }
- public static class StudentManagement {
- private Student[] students;
- private int student_count;
- StudentManagement() {
- this.students = new Student[100];
- student_count = 0;
- }
- public static Boolean sameGroup(Student s1, Student s2) {
- return s1.group == s2.group;
- }
- public void addStudent(Student newStudent) {
- if (this.student_count < 100) {
- students[student_count] = new Student(newStudent.name, newStudent.id, newStudent.group, newStudent.email);
- student_count++;
- }
- }
- public String studentByGroup() {
- Boolean[] checked = new Boolean[student_count];
- for (int i = 0; i < student_count; i++)
- checked[i] = false;
- }
- public void removeStudent(String findid) {
- int index = 0;
- for (int i = 0; i < student_count; i++)
- if (this.students[i].id == findid) {
- for (int k = 0; i < student_count; i++)
- students[i] = students[i + 1];
- student_count--;
- }
- }
- }
- public static void main(String[] args) {
- Student studentAn = new Student("Nguyen Van An", "17020001", "k62CC", "17020001@vnu.edu.vn");
- int[] a = new int[100];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement