Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Sep 11, 2013, 10:01 AM   #1
windels
macrumors regular
 
Join Date: Oct 2008
Location: Belgium
C++: object-oriented programming exercises

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!
windels is offline   0 Reply With Quote
Old Sep 11, 2013, 12:07 PM   #2
ArtOfWarfare
macrumors 603
 
ArtOfWarfare's Avatar
 
Join Date: Nov 2007
Send a message via Skype™ to ArtOfWarfare
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...
__________________
Don't tell me Macs don't last: 2007 iMac, 2007 Mac Mini, 2008 MacBook Air, all Vintage.
(iMac obsoletion: April 28, 2015, MBA: October 14, 2015, Mac Mini: March 9, 2016)
ArtOfWarfare is offline   0 Reply With Quote
Old Sep 12, 2013, 02:53 AM   #3
windels
Thread Starter
macrumors regular
 
Join Date: Oct 2008
Location: Belgium
thank you both for the advice! I'll look into it!
windels is offline   0 Reply With Quote
Old Sep 13, 2013, 09:30 AM   #4
robvas
macrumors 68000
 
Join Date: Mar 2009
Location: USA
Schildt's books are bad.

- Accelerated C++ - Andrew Koenig & Barbara E Moo - http://www.acceleratedcpp.com/
- C++ Primer 4th Edition - Stan Lippmann, Josie Lajoie & Barbara Moo
- Programming: Principles and Practice using C++ - Bjarne Stroustrup - http://www.stroustrup.com/Programming/
robvas is offline   0 Reply With Quote
Old Sep 13, 2013, 12:34 PM   #5
windels
Thread Starter
macrumors regular
 
Join Date: Oct 2008
Location: Belgium
Quote:
Originally Posted by robvas View Post
Schildt's books are bad.
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!
windels is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Resolved: How do I convert an NSData object to an NSDictionary object, and vice versa? moonman239 iPhone/iPad Programming 6 May 2, 2014 01:17 PM

Forum Jump

All times are GMT -5. The time now is 03:14 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC