Need C++ Exercises

Started by
15 comments, last by Zahlman 17 years, 1 month ago
OK. So I'm giving this C++ lab but the textbook doesn't seem to provide a lot of exercises. I've been scoundering the internet for about an hour and found a little bit of material but I guess more is needed. The course is an introduction to programming (as in C in C++ of sorts), with no classes (no OOP at all)... All resources are appreciated, thanks
[ my blog ]
Advertisement
Well, what do you intend to teach? Expressions? Loops? Exceptions? Memory allocation? Pointers? References? Const correctness? Functions? SC++L?

Usually, once you know what you want to teach about, it's easy to set up small exercises to be performed.
SC++L?
Other than that, yes these are the things I want to solve with these students.. I don't think am qualified enough to make my own set of exercises (I do make them draw a lot of stars in the console though).
I can solve with them a lot though. (3 continuous hours weekly lab, +1 hours solving session on the board for questions and the likes).
I didn't make my twenties yet and my C++Skills is about 4 years. But I am a student as well so I don't have the luxury of the time for making exercises / neither do I claim capability.

I heard about Schaum's Outlines to Programming in C++ or something like that. Anyone recommends it, any other EXERCISE textbook recommendation?
[ my blog ]
I think that this may be what you are looking for. I used this to learn C++, a very good book. This link is to Amazon so you can use the "Search Inside" feature :)

Click here
Sorry, login duffed up there! Link here:

http://www.amazon.com/Beginning-C++-Game-Programming-Development/dp/1592002056
Tough. Though, I'm not that much older than you, and I make my own exercises (although in Caml Light). What I would suggest is to get an algorithms book from your local library (or, better yet, buy it!) such as the Cormen-Leiserson-Rivest-Stein Introduction To Algorithms, and make them implement some of the algorithms there in C++. It usually serves as a great introduction to the basics of the language, while providing them with a goal that feels greater than HelloWorld or FizzBuzz.

Reimplementing standard library features (sort, heap, stack, queue, reverse) are always a possibility. Also, some of my personal favourites are:
  • Counting the number of primes smaller than 180,000.
  • Determining how many iterations it takes for the syracuse sequence to reach 1, starting from an arbitrary seed.
  • Given a sequence of daily stock market prices, determine when to buy and when to sell (buy before selling) to maximize profit.
  • Print out all Dyck words of a given length.


SC++L : Standard C++ Library
"Int. to Algorithms" would be too harsh on them at this point because they just got into arrays. The course is mainly C in C++ disguise. (They think the difference between C++ and C is just printf and cout at this point).

Anyway, I got this Schaum book and it has some neat exercises (some about Monte Carlo's Method which caught my attention).

I think it'll be all arithmetic exercises and a bunch of sort and search. I have to get working on it I guess.. Thanks for the replies
[ my blog ]
In this book there are a lot of simple C++ examples and sample code :

http://www.amazon.com/Sams-Teach-Yourself-C++-Days/dp/0672327112

I found it to be an excellent starter book!
You can find easy ACM questions for them to do here. Many of them are trivial, and you can use them to think of good exercises.
Quote:Original post by Replicon
You can find easy ACM questions for them to do here. Many of them are trivial, and you can use them to think of good exercises.


Thanks a big time! Exactly the kind of thing am searching for!
[ my blog ]

This topic is closed to new replies.

Advertisement