Short pseudocode..Driving a car ...please correct

Thread Solved

Join Date: Dec 2008
Posts: 6
Reputation: clb8372 is an unknown quantity at this point 
Solved Threads: 0
clb8372 clb8372 is offline Offline
Newbie Poster

Short pseudocode..Driving a car ...please correct

 
0
  #1
Dec 12th, 2008
  • 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.
  1.  
  2. Main
  3. Class driving a car (door, ignition, Key, seat belt, mirror, gear, and accelerator)
  4. In the driver seat
  5. With car
  6. End program
  7. In the driving seat
  8. Close the Door
  9. Seat belts on
  10. Use key for ignition
  11. Check Mirror
  12. Engage Gears
  13. Press Accelerator
  14. End driving seat program
  15. With Car
  16. Set Door.close = true
  17. Set Seat-belt.on = true
  18. Call Ignition (Key)
  19. Call Mirror.adjust()
  20. Call Gears engage()
  21. Call Accelerator Press()
  22. End With Car Program
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,278
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 356
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Nearly a Posting Maven

Re: Short pseudocode..Driving a car ...please correct

 
0
  #2
Dec 12th, 2008
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.
Today is a gift, that's why it is called "The Present".
Make love, no war. Cave ab homine unius libri.
Danny
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 6
Reputation: clb8372 is an unknown quantity at this point 
Solved Threads: 0
clb8372 clb8372 is offline Offline
Newbie Poster

Re: Short pseudocode..Driving a car ...please correct

 
0
  #3
Dec 12th, 2008
  1. 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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2008
Posts: 2,278
Reputation: ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of ddanbe has much to be proud of 
Solved Threads: 356
ddanbe's Avatar
ddanbe ddanbe is offline Offline
Nearly a Posting Maven

Re: Short pseudocode..Driving a car ...please correct

 
0
  #4
Dec 14th, 2008
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
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum


Views: 1656 | Replies: 3
Thread Tools Search this Thread



Tag cloud for C++
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC