《JAVA OOP开发》英文版 Chapter 15 Case Study Class Roster Maintenance program

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

Design document -3 Design Document GradeRoster Program Class Purpose An object to model a graduate student GraduateStudent An object to model an undergraduate UndergraduateStudent student A javabook object to print out error MessageBox messages and messages from temporary output statements C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 15-6
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15 - 6 Design Document - 3 Design Document: GradeRoster Program Class Purpose GraduateStudent An object to model a graduate student. UndergraduateStudent An object to model an undergraduate student. MessageBox A javabook object to print out error messages and messages from temporary output statements

Grade roster Program: Object Diagram GradeRoster Control Under Grade RosterMain Grade roster GradeRoster Grade Roster MainWindow Display Graduate Student Storage C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 15-7
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15 - 7 Grade Roster Program: Object Diagram GradeRosterMain GraduateStudent UndergraduateStudent GradeRoster GradeRosterDisplay GradeRosterStorage GradeRosterControl GradeRosterMainWindow

Development steps 1. Start with the program skeleton. Define the gradeRoster Main and skeleton GradeRoster MainWindow classes 2. Implement the methods to create a new roster. 3. Implement the methods to add students to a roster. 4. Implement the methods to delete students from a roster. 5. Implement the methods to edit student information 6. Implement the methods to edit test scores and compute the final course grades 7. Implement the methods to display the student information of a single student or all students 8. Implement the methods to save a roster to a file and read a roster from a file 9. Finalize and look for improvements C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15-8
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15 - 8 Development Steps 1. Start with the program skeleton. Define the GradeRosterMain and skeleton GradeRosterMainWindow classes. 2. Implement the methods to create a new roster. 3. Implement the methods to add students to a roster. 4. Implement the methods to delete students from a roster. 5. Implement the methods to edit student information. 6. Implement the methods to edit test scores and compute the final course grades. 7. Implement the methods to display the student information of a single student or all students. 8. Implement the methods to save a roster to a file and read a roster from a file. 9. Finalize and look for improvements

Step 1: Program Shell with Menus Objects o Do GradeRoster- Implement the full class. The m Main method creates an instance of ain Grade Window and calls its setVisible method Step 1 GradeRoster- Implement the shell of the main class that MainWindow includes menu choices and corresponding methods for processing menu choices C 2000 McGraw-Hill troduction to Object-Oriented Programming with Java--Wu Chapter 15-9
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15 - 9 Step 1: Program Shell with Menus Step 1 Objects To Do GradeRosterMain Implement the full class. The main method creates an instance of GradeRosterMainWindowand calls its setVisible method. GradeRosterMainWindow Implement the shell of the main class that includes menu choices and corresponding methods for processing menu choices

Step 2: Create a New Roster Objects TO Do Graderoster- Implement the methods Mainwindow rOster create NewRoster etNewtitle Modify the constructor as necessary Add a Response Box called save Box as a new data membe Step 2 Define constants SAVE. NO SAVE and CANCEL Grade Roster- Implement the methods Control constructor> etCourse Title as Grade Rose newGrade roster Add Input Box as a new data member Graderoster Implement the methods getTitle C 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15-10
© 2000 McGraw-Hill Introduction to Object-Oriented Programming with Java--Wu Chapter 15 - 10 Step 2: Create a New Roster Step 2 Objects To Do GradeRosterMainWindow Implement the methods newRoster createNewRoster setNewTitle Modify the constructor as necessary. Add a ResponseBox called saveBox as a new data member. Define constants SAVE, NO_SAVE, and CANCEL. GradeRosterControl Implement the methods getCourseTitle hasGradeRoster newGradeRoster Add InputBox as a new data member. GradeRoster Implement the methods getTitle
按次数下载不扣除下载券;
注册用户24小时内重复下载只扣除一次;
顺序:VIP每日次数-->可用次数-->下载券;
- 《JAVA OOP开发》英文版 Chapter 14 Inheritance and Polymorphism.ppt
- 《JAVA OOP开发》英文版 Chapter 13 GUI Objects and Event-Driven Programming.ppt
- 《JAVA OOP开发》英文版 Chapter 12 Reusable classes and packages.ppt
- 《JAVA OOP开发》英文版 Chapter 11 File Input and Output.ppt
- 《JAVA OOP开发》英文版 Chapter 10 Sorting and Searching.ppt
- 《JAVA OOP开发》英文版 Chapter 9 objectives.ppt
- 《JAVA OOP开发》英文版 Chapter 8 Characters and strings.ppt
- 《JAVA OOP开发》英文版 Chapter 7 Repetition Statements.ppt
- 《JAVA OOP开发》英文版 Chapter 6 Selection statements.ppt
- 《JAVA OOP开发》英文版 Chapter 5 Processing Input with Applets.ppt
- 《JAVA OOP开发》英文版 Chapter 4 Defining Instantiable Classes.ppt
- 《JAVA OOP开发》英文版 Chapter 3 Numerical Data.ppt
- 《JAVA OOP开发》英文版 Chapter 2 Java Programming Basics.ppt
- 《JAVA OOP开发》英文版 Chapter 1 Introduction to Object-oriented Programming and Software Development.ppt
- 《JAVA OOP开发》英文版 Introduction to Computers and Programming Languages.ppt
- 《Windows DNA应用程式》 面向对象分析与设计讲义.ppt
- 北大青鸟:《程序设计基础:C语言实现》课程教学资源(PPT课件讲稿)第四章 第四讲 分支结构.ppt
- 北大青鸟:《程序设计基础:C语言实现》课程教学资源(PPT课件讲稿)第十二章 文件.ppt
- 北大青鸟:《程序设计基础:C语言实现》课程教学资源(PPT课件讲稿)第十一章 复杂数据类型及排序.ppt
- 北大青鸟:《程序设计基础:C语言实现》课程教学资源(教案讲义)第六讲 数组.doc
- 《JAVA OOP开发》英文版 Chapter 16 Chapter 16 Recursive algorithms.ppt
- 人民邮电出版社:高职高专现代信息技术系列教材《单片机原理与接口技术》课程电子教案(PPT课件讲稿)第一章 绪论.ppt
- 人民邮电出版社:高职高专现代信息技术系列教材《单片机原理与接口技术》课程电子教案(PPT课件讲稿)第七章 牛行接与应用.ppt
- 人民邮电出版社:高职高专现代信息技术系列教材《单片机原理与接口技术》课程电子教案(PPT课件讲稿)第三章 MCS-51单片机指令系统.ppt
- 人民邮电出版社:高职高专现代信息技术系列教材《单片机原理与接口技术》课程电子教案(PPT课件讲稿)第九章 A/D、D/A转换接口.ppt
- 人民邮电出版社:高职高专现代信息技术系列教材《单片机原理与接口技术》课程电子教案(PPT课件讲稿)第二章 MCS-51学机组成理.ppt
- 人民邮电出版社:高职高专现代信息技术系列教材《单片机原理与接口技术》课程电子教案(PPT课件讲稿)第五章 输入/输出与中断.ppt
- 人民邮电出版社:高职高专现代信息技术系列教材《单片机原理与接口技术》课程电子教案(PPT课件讲稿)第八章 并行接口与应用.ppt
- 人民邮电出版社:高职高专现代信息技术系列教材《单片机原理与接口技术》课程电子教案(PPT课件讲稿)第六章 定时器/计数器及应用.ppt
- 人民邮电出版社:高职高专现代信息技术系列教材《单片机原理与接口技术》课程电子教案(PPT课件讲稿)第十章 单片机应用系统设计与开发.ppt
- 人民邮电出版社:高职高专现代信息技术系列教材《单片机原理与接口技术》课程电子教案(PPT课件讲稿)第四章 MCS-51单片机存储器的扩展.ppt
- 《网络安全设计》 第一章 安全设计简介.ppt
- 《网络安全设计》 第二章 创建网络安全计划.ppt
- 《网络安全设计》 第三章 确定网络安全威胁.ppt
- 《网络安全设计》 第四章 分析安全风险.ppt
- 《网络安全设计》 第五章 创建物理资源安全设计.ppt
- 《网络安全设计》 第六章 创建计算机安全设计.ppt
- 《网络安全设计》 第七章 创建账户安全设计.ppt
- 《网络安全设计》 第八章 身份验证的安全设计.ppt
- 《网络安全设计》 第九章 数据安全设计.ppt