- Identify a task you perform regularly, such as cooking, mowing the lawn, or driving a car
- Write a short, structured design (pseudocode only) that accomplishes this task.
- Think about this task in an object-oriented way, and identify the objects involved in the task.
- Identify how you can encapsulate the data and processes you identified into an objectoriented design.
Driving a
Car
Main
Class driving a car (door, ignition, Key, seat belt, mirror,
gear, and accelerator)
Sit in the driver
seat
With car
End program
Sit in
the driver seat
Close the Door
Seat belts on
Use key for ignition
Check Mirror
Engage Gears
Press Accelerator
End driver seat program
With Car
Set Door.close = true
Set Seat-belt.on = true
Call Ignition (Key)
Call Mirror.adjust()
Call Gears engage()
Call Accelerator Press()
End
With Car Program
Cheryl BurnettPosted Dec 14, 2008, 12:55 AM
Bechir BejaouiPosted Dec 13, 2008, 7:02 PM
If yes, then make an effort and try to make the first step by making your own algorithm, a vietnamian proverb says exercices make the good trainer
don't worry about the failures or mistakes just try and I will be here to correct your code.