Document 9654238

Download Report

Transcript Document 9654238

Matakuliah
Tahun
: T0104 – Metode Perancangan Program
: 2010
SIMPLE OBJECT ORIENTED DESIGN
Pertemuan - 20
Pertemuan - 20
Simple Object Oriented Design
Objectives
• To become familiar with the steps in creating an
simple object oriented design solution to a problem
• Develop an object-oriented design solution to a oneclass problem
The steps in designing an object-oriented
solution for a simple programming problem
•
Three steps to follow to create an simple objectoriented solution:
1.
Identify the classes and their attributes, responsibilities
and operations.
2.
Design the algorithms for the operation, using structured
design.
3.
Develop a test or driver algorithm to test the solution.
Simple Object Oriented Design
• Case Study
– Examine Example 11.5 Print student results on pages 207.
Simple Object Oriented Design
• Case Study Problem Satatements
– Example 11.5 Print student results on pages 207
Design a class to manage student results in a subject. Each
student is identified by a unique student number. During the
course of the subject, each student completes three assignments
representing 40% of the final mark but each scored out of 100,
and an examination, also scored out of 100 marks
Simple Object Oriented Design
• Case Study Object Oriented Design Solutions:
Use three steps refered to Example 11.5 Print student results which
depicts all the processes involved in finding the solution as
illustrated on pages 207 through 212 of the textbook
– Step 1: Identify the classes and their attributes, responsibilities
and operations on pages 207 through 209
– Step 2: Design the algorithms for the operation, using structured
design on pages 209 through 210
– Step 3: Develop a test or driver algorithm to test the solution on
pages 210 through 212
Summary
•
Three steps in creating an object-oriented solution
for a problem with just one class:
1.
Identify the objects and their attributes, responsibilities and
operations
2.
Design the algorithms for the operations and methods
using structured design
3.
Develop a test or driver algorithm to test the solution
The Code