dcsimg
www.webdeveloper.com
Results 1 to 6 of 6

Thread: Help With Psuedocode?!

  1. #1
    Join Date
    Oct 2013
    Posts
    8

    Help With Psuedocode?!

    I need help writing a psuedocode. I need to implement these three classes of cars (Race Car, Log Truck, and Luxury Car) and each of their attributes.. I'm not too familiar with Psuedocode.. Any help?


    Race Car
    o Year
    o Make
    o Model
    o Type
    o Color
    o Maximum Speed
    o 0-60 Speed
    o Quarter Mile Speed
    o Horse Power

    Log Truck
    o Year
    o Make
    o Model
    o Type
    o Color
    o Maximum Pull Weight
    o Log Capacity
    o Trailer Length
    o Horse Power

    Luxury Car
    o Year
    o Make
    o Model
    o Type
    o Color
    o Horse Power

  2. #2
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,143
    class raceCar
    set year
    set make
    set model
    set type
    set color
    set maxspeed
    set zerotosixtyspeed
    set qmspeed
    set hp

    class logTruck
    ...
    ...
    ...
    ..etc

  3. #3
    Join Date
    Oct 2013
    Posts
    8
    Quote Originally Posted by cbVision View Post
    class raceCar
    set year
    set make
    set model
    set type
    set color
    set maxspeed
    set zerotosixtyspeed
    set qmspeed
    set hp

    class logTruck
    ...
    ...
    ...
    ..etc
    Thank you!

  4. #4
    Join Date
    Oct 2013
    Posts
    8
    Okay so this is what my psuedocode looks like now but apparently I need to tweak it a little before it's done. I need to move all of the common properties to a generic class called "automobile".

    then, I need to only put the differentiating properties in the specific vehicle classes. Indicate that each specific automobile type inherits from the generic "automobile".

    Any help with this would be greatly appreciated! here is what I have so far..

    ImplementCarClasses Module

    class raceCar
    set year
    set make
    set model
    set type
    set color
    set maxspeed
    set zerotosixtyspeed
    set qmspeed
    set hp

    classlogtruck
    set year
    set make
    set model
    set type
    set color
    set maxpull
    set logcap
    set trailorlength
    set hp

    classluxurycar
    set year
    set make
    set model
    set type
    set color
    set hp

    End Module

  5. #5
    Join Date
    Oct 2013
    Posts
    8
    Bump

  6. #6
    Join Date
    Sep 2008
    Location
    Akron, OH
    Posts
    1,143
    ImplementCarClasses Module

    class automobile
    set year
    set make
    set model
    set type
    set color
    set hp

    class raceCar extends automobile
    set maxspeed
    set zerotosixtyspeed
    set qmspeed

    classlogtruck extends automobile
    set maxpull
    set logcap
    set trailorlength

    classluxurycar extends automobile

    End Module

    I believe you need to create the automobile class to have all the shared attributes as seen above. Then extend your other classes and include any attributes specific to those classes.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles