Short pseudocode... driving a car... I am new to using this type of language, so can someon please correct this.

Dec 12 2008 4:02 PM
  • 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


Answers (2)