3-ReviewAnswers - C SC 335 Review Question Answers Module 3...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
C SC 335 Review Question Answers Module 3 - UML 1. JGrader public class GradeBook { private ArrayList collection; public GradeBook( ) { collection = new ArrayList( ); } public void addStudent( String name ) { Student newStudent = new Student( name ); collection.add( newStudent ); } public Student removeStudent( String name ) { Student temp = getStudent( name ); if ( temp != null ) collection.remove( temp ); return temp; } public Student getStudent( String name ) { Student temp; for( int i = 0; i < collection.size( ); i++ ) { temp = (Student)collection.get( i ); if ( temp.getName().equals( name ) ) return temp; } return null; } public void addGrade( String name, double grade ) { Student temp = getStudent( name ); if ( temp != null ) temp.addGrade( grade ); } public Iterator getStudentIterator( ) { return collection.iterator( ); } }
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
2. Account Management Application An appropriate UML class diagram would have the following constructs.
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

3-ReviewAnswers - C SC 335 Review Question Answers Module 3...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online