Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/com/generation/model/Student.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ public class Student

private final Map<String, Course> approvedCourses = new HashMap<>();


public Student( String id, String name, String email, Date birthDate )
{
super( id, name, email, birthDate );
Expand All @@ -24,6 +25,10 @@ public Student( String id, String name, String email, Date birthDate )
public void enrollToCourse( Course course )
{
//TODO implement this method

courses.add( course );


}

public void registerApprovedCourse( Course course )
Expand All @@ -35,7 +40,14 @@ public void registerApprovedCourse( Course course )
public boolean isAttendingCourse( String courseCode )
{
//TODO implement this method
return false;
if(courseCode == courseCode) {
return true;
} else {
return false;
}



}

@Override
Expand Down
2 changes: 2 additions & 0 deletions src/com/generation/service/StudentService.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ public Student findStudent( String studentId )
public void showSummary()
{
//TODO implement

System.out.println(students);
}

public void enrollToCourse( String studentId, Course course )
Expand Down
4 changes: 2 additions & 2 deletions src/com/generation/utils/PrinterHelper.java
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ public static Student createStudentMenu( Scanner scanner )
String id = scanner.next();
System.out.println( "| Enter student email: |" );
String email = scanner.next();
System.out.println( "| Enter student birth date(mm/dd/yyyy)|" );
DateFormat formatter = new SimpleDateFormat( "mm/dd/yyyy");
System.out.println( "| Enter student birth date(MM/DD/YYYY)|" );
DateFormat formatter = new SimpleDateFormat( "MM/dd/yyyy");
//TODO validate date format and catch exception to avoid crash
Date birthDate = formatter.parse( scanner.next());
System.out.println( "|-------------------------------------|" );
Expand Down