You are part of HR IT department and your Team lead has asked you to create a Java program using the steps described within Requirements section below.
Ensure that your java file compiles without any errors and each n every section is well documented using block comments, in-line comments, and @param tags (wherever applicable). Note: if the java file compiles with any error at all, submission will be completely rejected hence earning 0 score towards this project.
1. Create a new java file named Student.java and add Student class by using the following UML diagram:
Student |
- StudentId: int - Name: String - FullTime: boolean - Courses: ArrayList< String> |
+ Student() + Student(id: int, FName: string, FTime: boolean) + Student(id: int, Fname: string, FTime: boolean, CourseList: ArrayList< String>) + toString(): String + DisplayFullTimeStatus(): void + DisplayCourses(): void + UpdateFullTimeStatus(): void + UpdateCourses(Course: String): void + WriteStudentInfoToFile(): void |
2. Instantiate 3 students using the following attributes:
Student Id | Full Name | Full Time ? | Courses |
1 | John Doe | Yes | Java, C# |
2 | Tom Seth | No | PHP, Networking |
3 | Jane King | Yes |
Hint: 3rd line above should be using the constructor that does not require Course information to be provided.
3. Implement toString method to return Student info in the following format:
Hello, I am John Doe, my Id is: 1, I am a Full time student, and I am enrolled in Java, C# courses.
4. Display student info for all 3 student objects created in previous step by calling toString method
5. Implement and Call DisplayFullTimeStatus method on all 3 student objects to display the info in the format:
Hello, I am John Doe, my Id is: 2 and I am a Part time student.
6. Implement and Call DisplayCourses method on all 3 student objects to display the info in the format:
Hello, I am John Doe, my Id is: 1 and I am enrolled in Java, C# courses.
Note: If no courses found (example student with Id = 3, it should display message like:
Hello, I am John Doe, my Id is: 3 and I am NOT enrolled in any course yet.
7. Implement and Call UpdateFullTimeStatus method to update the status. For the student with Id=2, update the status to Full time and then call DisplayFullTimeStatus method for this student to display updated status.
8. For the student with Id=3, call UpdateCourses method twice, by passing 1 new course name in each call, to update the course list. Here is an example:
S3.UpdateCourses("Project Management");
Note: Check existing list before adding, there should not be a duplicate entry.
9. Then call DisplayCourses method for this student to display updated course list.
10.Finally, for all 3 students, call WriteStudentInfoToFile method and write the student info (all attributes on a single line by appending them and separating using a pipe sign like: 1|John Doe|Full Time|Java, C# into a file named: Student_Records.txt (create the file if it does not exist, append to the file if it exists).