Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.c++ > #5500 > unrolled thread

Re: Looking for tutorial example classes

Started byBjörn <hen03@nurfuerspam.de>
First post2011-05-25 16:29 +0200
Last post2011-05-25 16:29 +0200
Articles 1 — 1 participant

Back to article view | Back to comp.lang.c++

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Looking for tutorial example classes Björn <hen03@nurfuerspam.de> - 2011-05-25 16:29 +0200

#5500 — Re: Looking for tutorial example classes

FromBjörn <hen03@nurfuerspam.de>
Date2011-05-25 16:29 +0200
SubjectRe: Looking for tutorial example classes
Message-ID<944i2nFu8bU1@mid.dfncis.de>
Stefan Ram wrote:

>   complex numbers
> 
>   People often criticize this, because they say that this is
>   already available in ::std and one should not reinvent the
>   wheel. Moreover, my students are beginners often with very
>   poor math capabilities, so some of them might be alienated
>   by anything that uses too much math (or, any math at all).

For teaching purposes I'd rather welcome parts of the STL, because people 
would learn STL as well. Of course, the resulting class should behave 
exactly as the original in ::std as far as it's implemented (e.g., have the 
same error handling).

But if the students do not know complex numbers at all I'd not recommend 
that.

>   So does anyone have any other idea? The class should
> 
>       - not implement something already available in
>         standard C++
> 
>       - have a need for at least two private fields
>         of data
> 
>       - use some math (e.g., when overloading »+«),
>         but the math should be very simple

What about modulo operations? You could start with the modulo as a private 
constant and if you plan to teach templates, later, you can reuse your 
example and make it a template parameter.

Regards
Björn

[toc] | [standalone]


Back to top | Article view | comp.lang.c++


csiph-web