Share
Explore BrainMass

Object-Oriented Data and Processes Pseudocode

Identify a task you perform regularly, such as 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 object oriented design.
- Describe the architectural differences between the object-oriented and structured designs. Which of the designs makes more sense to you? Why?

Solution Preview

Pseudo code for Driving a Car:

driveCar(key,door,gear,accelerator,clutch)
{
if (water_of_car is less) then
fillWater();
if (oil_of_car is less) then
fillOil();
getIntoCar();
insertKey();
enginestatus=startEngine();

if(enginestauts==ON)
releaseHandBreak();
moveCar();

while(engineStatus==ON)
{
if(moveCar) then
switchGear();
}//end of while

}// end of driveCar()

// sub modules

fillWater()
{
Fill the radiator with enough Water;
}
fillOil()
{
fill the Oil tank;
}

getIntoCar()
{
open door;
go inside the car;
}

insertKey()
{
take the key and insert it into the key holder;
}

startEngine()
{
press the start button to start the engine of the ...

Solution Summary

This solution provides a short pseudocode that accomplishes the task of driving a car.

$2.19