Thread: Can I get some idea for exercise?

  1. #1
    Registered User
    Join Date
    Sep 2007
    Posts
    8

    Can I get some idea for exercise?

    Hi all
    I am looking for an exercise for myslef that will take 3-4 hours to practice pholymorphism/abstraction do you have idea for exercise, or do you know where can I get one?
    searching the net I found easy question, and I want something that will take 3-5 hours
    thanks

  2. #2
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    implement a data driven finite state machine framework (build state and transitions described by data given in files).
    Option 1: support various file formats: xml, binary(+editor)
    Option 2: Support states that are state machines them self
    Option 3: graphical output of state machines
    Option 4: graphical input of state machines (should not be possible in your time frame)
    Option 5: Build an execution environment, so the machines can do something meaningful

    That should include a lot of abstraction and polymorphism as well
    Last edited by pheres; 11-21-2007 at 06:21 AM.

  3. #3
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Common first polymorphism class would be an "animals" class, where you start with a basic anmial, and then derive classes like cat, dog, fish, parrot, etc.

    That may be too simple, but it's a starting point for learning polymorphism.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  4. #4
    NotSoAvgProgrammer
    Join Date
    Jul 2007
    Location
    Virginia, U.S.
    Posts
    57
    You could make a kd-tree, and use polymorphisms for the nodes. Wiki it, it's can be used for many different things, but I use it for collision detection in my games.

    Joe
    A quality job is not necessarily a *good* job. A quality job is, by definition, conformance to requirements. Therefore a *good* job, may not be a quality job.

  5. #5
    Registered User
    Join Date
    May 2006
    Posts
    903
    Quote Originally Posted by matsp View Post
    Common first polymorphism class would be an "animals" class, where you start with a basic anmial, and then derive classes like cat, dog, fish, parrot, etc.

    That may be too simple, but it's a starting point for learning polymorphism.

    --
    Mats
    That's exactly what I was thinking about. That or a Shape class like in Bjarne Stroustrup's book.

  6. #6
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    Another variation is a number class that can input/output the number in various forms, e.g. a decimal number, hex number, octal number, binary number, roman number etc. [The decimal, hex, octal and binary are probably best implemented as a common-derived form that has a "base" member that is 10, 16, 8 and 2 respectively - so you have two levels of inheritance].

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  7. #7
    Registered User kroiz's Avatar
    Join Date
    Jun 2007
    Posts
    116

    Lightbulb

    You can make a program that will find the answer to life the universe and everything.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. project idea ???
    By gemini_shooter in forum C Programming
    Replies: 2
    Last Post: 06-09-2005, 09:56 AM
  2. Have an idea?
    By B0bDole in forum Projects and Job Recruitment
    Replies: 46
    Last Post: 01-13-2005, 03:25 PM
  3. A little problem about an idea, help please
    By louis_mine in forum C++ Programming
    Replies: 3
    Last Post: 09-10-2004, 09:52 PM
  4. totally screwed up idea
    By iain in forum A Brief History of Cprogramming.com
    Replies: 9
    Last Post: 08-17-2001, 12:09 PM