Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

windels

macrumors regular
Original poster
Oct 12, 2008
227
5
Belgium
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!
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,560
6,059
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...
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.