Share
Explore BrainMass

Object Oriented Design of a Car

? Identify how you can encapsulate the data and processes you identified into an object-oriented design.

? Describe the architectural differences between the object-oriented and structured designs. Which of the designs makes more sense to you? Why?

___________________________________________________________________________
Driving a Car
Objects:
1. Car has the following objects (door, ignition, seat belt, mirror, gear, and accelerator)
2. Key

In the driving seat
Close the Door
Seat belts on
Use key for ignition
Check Mirror
Engage Gears
Press Accelerator

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

Attachments

Solution Preview

Please see the attached file.

? Identify how you can encapsulate the data and processes you identified into an object-oriented design.

Object Car uses Object { door, ignition, seat-belt, mirror, gear, accelerator}
Object door{
Properties:
Boolean close
}
Object ignition interfaces with Object key{
Method:
start(Object key)
}

Object ...

Solution Summary

Shows how to model a car as a object in OOPL.

$2.19