C++: object-oriented programming exercises

Discussion in 'Mac Programming' started by windels, Sep 11, 2013.

  1. macrumors regular

    windels

    Joined:
    Oct 12, 2008
    Location:
    Belgium
    #1
    Hi!

    for my master thesis I'm expected to programm using C++. I already worked my way through: C++ A Beginner’s Guide by Herbert Schildt. I get most of it, but I need some more excercises in order to improve my skills.


    More in particular I'm looking for (preferably online) exercises and solutions that focus on object-oriented programming( i.e. the use of classes). To be clear,I don't really need any more exercises that focus on pure syntax (e.g. exercises on arrays, pointers...)


    I already started working my way through these excercises. Any other suggestions?


    Thank you in advance!
     
  2. macrumors 603

    ArtOfWarfare

    Joined:
    Nov 26, 2007
    #2
    Those exercises don't seem to cover inheritance in any way.

    Adding on to those exercises (I'm making this up on the fly)

    10 - Make a class called person, having a name and sex. Have student inherit from person.

    11 - Also give person a description method. Have that print out the name and sex of the person. Have student use person's description method, and then also print out the total score of the student.

    12 - Make a new class called score which stores three integer: points possible, points earned, and percentage. Replace all the score properties on student with that score class.

    C++ has multiple inheritance... no exercise is coming to mind for integrating that into what you're already using...
     
  3. thread starter macrumors regular

    windels

    Joined:
    Oct 12, 2008
    Location:
    Belgium
    #3
    thank you both for the advice! I'll look into it!
     
  4. macrumors 68000

    Joined:
    Mar 29, 2009
    Location:
    USA
    #4
  5. thread starter macrumors regular

    windels

    Joined:
    Oct 12, 2008
    Location:
    Belgium
    #5
    Yeah, I came to discover that myself. Unfortunately it was the book school recommended... Thanks for the other books. Again, I'll look into it . Thanks!
     

Share This Page