Jump to content
  • Advertisement
Sign in to follow this  
arithma

Need C++ Exercises

This topic is 4113 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
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

Share this post


Link to post
Share on other sites
Sorry, login duffed up there! Link here:

http://www.amazon.com/Beginning-C++-Game-Programming-Development/dp/1592002056

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
"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

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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!

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!