Document 9654233

Download Report

Transcript Document 9654233

Matakuliah
Tahun
: T0104 – Metode Perancangan Program
: 2010
SIMPLE OBJECT ORIENTED DESIGN
Pertemuan - 19
Pertemuan - 19
Simple Object Oriented Design
Objectives
• To list the steps required to create an object-oriented
design solution to a 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
• Example Simple Object Oriented Design:
– Examine Example 11.4 Process Exam Scores on pages 204.
Simple Object Oriented Design
• Simple Problem Satatements:
– Example 11.4 Process Exam Scores on pages 204
Design a class that will receive four scores from a mathematics
test, calculate the total and average scores and display the total
and average scores to the screen.
Simple Object Oriented Design
• Object Oriented Design Solutions:
Use three steps refered to Example 11.4 Process Exam Scores
which depicts all the processes involved in finding the solution as
illustrated on pages 204 through 207 of the textbook
– Step 1: Identify the classes and their attributes, responsibilities
and operations on pages 204 through 205
– Step 2: Design the algorithms for the operation, using structured
design on pages 205 through 206
– Step 3: Develop a test or driver algorithm to test the solution on
pages 206 through 207
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