| | |
Short pseudocode..Driving a car ...please correct
Thread Solved |
•
•
Join Date: Dec 2008
Posts: 6
Reputation:
Solved Threads: 0
•
•
•
•
- 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.
C++ Syntax (Toggle Plain Text)
Main 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
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.
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.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
•
•
Join Date: Dec 2008
Posts: 6
Reputation:
Solved Threads: 0
C++ Syntax (Toggle Plain Text)
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.
Last edited by ddanbe; Dec 14th, 2008 at 5:43 am.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Make love, no war. Cave ab homine unius libri.
Danny
![]() |
Other Threads in the C++ Forum
- Previous Thread: Drawing in C++
- Next Thread: capital letter
Views: 1656 | Replies: 3
| Thread Tools | Search this Thread |
Tag cloud for C++
algorithm api array arrays assignment beginner binary browser c++ c/c++ calculator char class classes code compile compiler constructor conversion convert count delete desktop dll dynamic encryption error exception file files filestream fstream function functions game givemetehcodez graph gui helpwithhomework homework i/o iamthwee input int integer lazy library link linker list loop looping math matrix member memory newbie news number object objects opengl operator output parameter path pointer pointers problem program programming project random read recursion recursive reference server sort spoonfeeding string strings struct student studio template templates text time tree undefined variable vc++ vector video visual win32 window windows winsock






