Identify Task
Mow lawn
Declare Lawn Mower as Real
Declare Pull start as Real
Declare safety Rod as Real
Psuedocode
Hold down safety bar
Pull start cord
Adjust Wheel Height
Start Lawnmower
Push forward
At obstacle change direction
Yard = task
Push mower
Complete task
End Program
Objects involved in task
Person, hands, feet, eyes
Yard, grass, obstacles
Mower, handle, wheels, blade,
Identify how to encapsulate the data and processes.
Class Mower
Body As Real
Wheels As Real
Subprogram SetMotor ( power)
Set Pull Cord = Starting Trigger
Start Mower
End Sub Program
Subprogram adjust idle
Adjust idle
End Subprogram
Subprogram = mow lawn
Push mower till obstacle
Obstacle = change direction
Task = yard
Mow till task complete
End subprogram
Function Enter - Mower ( ) as Real
This
preview
has intentionally blurred sections.
Sign up to view the full version.
Set “start mower” = starting mower
End Function
Function Task ( ) as Real
Set Complete Task = TaskComplete
End Function
End Class
Describe the architectural difference between Object oriented and structured
designs.
Which makes more sense and why?
This is the end of the preview.
Sign up
to
access the rest of the document.
- Spring '10
- some
- Networking, Object-Oriented Programming, Subroutine, Object Oriented, Declare Lawn Mower
-
Click to edit the document details