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


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

Re: Looking for tutorial example classes

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.dougwise.org!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!feeder.erje.net!news2.arglkargh.de!news.karotte.org!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail
From Björn <hen03@nurfuerspam.de>
Newsgroups comp.lang.c++
Subject Re: Looking for tutorial example classes
Followup-To comp.lang.c++
Date Wed, 25 May 2011 16:29:43 +0200
Lines 37
Message-ID <944i2nFu8bU1@mid.dfncis.de> (permalink)
References <example-20110524170932@ram.dialup.fu-berlin.de>
Mime-Version 1.0
Content-Type text/plain; charset="UTF-8"
Content-Transfer-Encoding 8Bit
X-Trace news.dfncis.de vU/gpmzZmNH9wM31Dds9wwttPaEYzRXFN6Kv3TeN83bzJQ
User-Agent KNode/4.4.8
Xref x330-a1.tempe.blueboxinc.net comp.lang.c++:5500

Followups directed to: comp.lang.c++

Show key headers only | View raw


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

Back to comp.lang.c++ | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web