Week 9 Homework
Instructions
This homework will give you practice with ArrayLists within a custom StudentRoster class.
Clone the link for the Howework 9 repository provided by your instructor.
Implement the StudentRoster class using the provided JavaDoc.
Sample Output
After completing StudentRoster, running the driver should be able to produce the output shown below.
Roster
ID: Name:
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
1
Enter the name and id on the same line, separated by a space. (e.g., Lily 9)
Jane 5
Adding student Jane with id 5.
Roster
ID: Name:
5 Jane
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
1
Enter the name and id on the same line, separated by a space. (e.g., Lily 9)
Sam 10
Adding student Sam with id 10.
Roster
ID: Name:
5 Jane
10 Sam
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
1
Enter the name and id on the same line, separated by a space. (e.g., Lily 9)
Sam 3
Adding student Sam with id 3.
Roster
ID: Name:
3 Sam
5 Jane
10 Sam
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
1
Enter the name and id on the same line, separated by a space. (e.g., Lily 9)
Amy 7
Adding student Amy with id 7.
Roster
ID: Name:
3 Sam
5 Jane
7 Amy
10 Sam
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
1
Enter the name and id on the same line, separated by a space. (e.g., Lily 9)
Jamie 5
ID already present in roster.
Roster
ID: Name:
3 Sam
5 Jane
7 Amy
10 Sam
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
1
Enter the name and id on the same line, separated by a space. (e.g., Lily 9)
Jamie 0
Adding student Jamie with id 0.
Roster
ID: Name:
0 Jamie
3 Sam
5 Jane
7 Amy
10 Sam
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
2
Enter the student name or id to look up.
4
No student with id 4
Roster
ID: Name:
0 Jamie
3 Sam
5 Jane
7 Amy
10 Sam
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
2
Enter the student name or id to look up.
Max
No student with name Max
Roster
ID: Name:
0 Jamie
3 Sam
5 Jane
7 Amy
10 Sam
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
2
Enter the student name or id to look up.
5
Student name: Jane
Roster
ID: Name:
0 Jamie
3 Sam
5 Jane
7 Amy
10 Sam
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
2
Enter the student name or id to look up.
Amy
Student id(s): [7]
Roster
ID: Name:
0 Jamie
3 Sam
5 Jane
7 Amy
10 Sam
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
2
Enter the student name or id to look up.
Sam
Student id(s): [3, 10]
Roster
ID: Name:
0 Jamie
3 Sam
5 Jane
7 Amy
10 Sam
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
3
Enter the student name or id to remove.
4
No student with id 4
Roster
ID: Name:
0 Jamie
3 Sam
5 Jane
7 Amy
10 Sam
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
3
Enter the student name or id to remove.
Max
No student with name Max
Roster
ID: Name:
0 Jamie
3 Sam
5 Jane
7 Amy
10 Sam
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
3
Enter the student name or id to remove.
Sam
Removing student with id: [3, 10]
Roster
ID: Name:
0 Jamie
5 Jane
7 Amy
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
3
Enter the student name or id to remove.
Jane
Removing student with id: [5]
Roster
ID: Name:
0 Jamie
7 Amy
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
3
Enter the student name or id to remove.
0
Removing student with name: Jamie
Roster
ID: Name:
7 Amy
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
4
Enter the id of the student whose name you would like to change.
7
Enter a new name for the student.
Finn
Name changed to Finn
Roster
ID: Name:
7 Finn
Enter a selection.
1. Enter a student.
2. Look up a student.
3. Remove a student.
4. Change a student name.
q. Quit.
q
QuittingSubmission
When you have completed StudentRoster and the output for the driver can match the sample output, add "DONE" to the README and then commit and push.