Chapter 15 Case stud Class Roster Maintenance Program 2000 McGraw-Hl‖ Introduction to Object-Oriented Programming with Java-Wu Chapter 15-1
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15 - 1 Chapter 15 Case Study: Class Roster Maintenance Program
Chapter 15 Objectives After you have read and studied this chapter, you should be able to e Develop large programs incrementally using multiple objects from object categories controller, storage, application logic, and user interface e Develop large programs that are extensible and modifiable by applying polymorphism and inheritance effectively in program design e Document how the methods in the classes are related by using method call sequence diagrams C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15-2
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15 - 2 Chapter 15 Objectives After you have read and studied this chapter, you should be able to Develop large programs incrementally using multiple objects from object categories controller, storage, application logic, and user interface. Develop large programs that are extensible and modifiable by applying polymorphism and inheritance effectively in program design. Document how the methods in the classes are related by using method call sequence diagrams
Sample Program: Computing Course Grades r Problem statement Write a class roster maintenance program that will allow the user to create a new roster Open an existing roster(can open one roster at a time) Save the current roster to a file Add and delete students from a roster Change the name of students. Edit the test scores of students. Display the name test scores, and course grade of a single studentor all students in the roster The program maintains both graduate and undergraduate students. For each student, we maintain his or her name test scores, and final course grade. The final course grade is computed by using the following formula(from Chapter 14 Type of Student Grading Scheme Undergraduate Pass if(test1+test2+test3)3>=70 Graduate Pass if(test1+test2test3)/3>=80 C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15-3
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15 - 3 Sample Program: Computing Course Grades Problem Statement Write a class roster maintenance program that will allow the user to Create a new roster. Open an existing roster (can open one roster at a time). Save the current roster to a file. Add and delete students from a roster. Change the name of students. Edit the test scores of students. Display the name, test scores, and course grade of a single student or all students in the roster. The program maintains both graduate and undergraduate students. For each student, we maintain his or her name, test scores, and final course grade. The final course grade is computed by using the following formula (from Chapter 14): Type of Student Grading Scheme Undergraduate Pass if (test1+test2+test3)/3 >= 70 Graduate Pass if (test1+test2+test3)/3 >= 80
Design document-1 Design Document: GradeRoster Program Class Purpose GradeRoster Main The main class of the program The top-level control object that manages subclass of Main Window from javabook. a GradeRoster MainWindow other objects in the program. The class An object that controls a Graderoster object. The object works under the control GradeRoster Control of GradeRoster Window the object manages StudentName Dialog and Testscore Dialog objects An object responsible for displaying class GradeRosterDisplay rosters. The object works under the control of graderoster mainWindow C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 15-4
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15 - 4 Design Document - 1 Design Document: GradeRoster Program Class Purpose GradeRosterMain The main class of the program. GradeRosterMainWindow The top-level control object that manages other objects in the program. The class is a subclass of MainWindow from javabook. GradeRosterControl An object that controls a GradeRoster object. The object works under the control of GradeRosterMainWindow. The object manages StudentNameDialog and TestScoreDialog objects. GradeRosterDisplay An object responsible for displaying class rosters. The object works under the control of GradeRosterMainWindow
Design document -2 Design Document GradeRoster Program Class Purpose An object for handling the file input and GradeRoster Storage out put operations. The obj ject works under the control of graderosterMain window An object that actually maintains the roster. GradeRoster The object works under the control of GradeRoster Control An abstract class that captures common Student behavior and data of both undergraduate and graduate students C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 15-5
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15 - 5 Design Document - 2 Design Document: GradeRoster Program Class Purpose GradeRosterStorage An object for handling the file input and output operations. The object works under the control of GradeRosterMainWindow. GradeRoster An object that actually maintains the roster. The object works under the control of GradeRosterControl. Student An abstract class that captures common behavior and data of both undergraduate and graduate students