• 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 object oriented
  • design.
Class driving a car (door, ignition, Key, seat belt, mirror, gear, and accelerator)
      In the driver seat
      With car 
End program
In the driving seat
       Close the Door
       Seat belts on
       Use key for ignition
       Check Mirror
       Engage Gears 
       Press Accelerator 
End driving 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

Recommended Answers

All 3 Replies

What do you think a driving seat has to do with a close of the door, or a mirror check?
You obviously have a car object. And it has a mirror, has that mirror something to do with driving? What about speed, tires,fuel amount,engine?
Maybe you need a road object?It is very hard to drive in a swamp with a car...
These are my initial thougths, hope it helps.

I see what your are saying , so to correct this, it looks like I should change In the driving seat to sit in the driver seat.

You must more think in objects. What do they have? what do they do? A driver seat is not really needed when driving a car ! (But it is handy if you have one) Think in a more abstract way of driving a car.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.