From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 109fba,29d04b3c5d4b6aae X-Google-Attributes: gid109fba,public X-Google-Thread: 103376,1b95e696d3d023d3,start X-Google-Attributes: gid103376,public X-Google-Thread: 1108a1,29d04b3c5d4b6aae X-Google-Attributes: gid1108a1,public X-Google-ArrivalTime: 1995-01-06 10:50:18 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!udel!gatech!howland.reston.ans.net!pipex!sunic!news.uni-c.dk!nbivax.nbi.dk!meyer.fys.ku.dk!sparre Newsgroups: comp.lang.c++,comp.object,comp.lang.ada Subject: Re: Teaching OO Message-ID: <1995Jan6.195018.2180@nbivax.nbi.dk> From: sparre@meyer.fys.ku.dk (Jacob Sparre Andersen) Date: 6 Jan 95 19:50:18 +0100 Followup-To: comp.object,comp.edu References: <3ehehd$61c@gutemine.informatik.uni-kiel.de> Nntp-Posting-Host: meyer.fys.ku.dk X-Newsreader: TIN [version 1.2 PL2]Lines: 33 Xref: nntp.gmd.de comp.lang.c++:85565 comp.object:19329 comp.lang.ada:17835 Date: 1995-01-06T19:50:18+01:00 List-Id: Please note that followup is set to comp.object and comp.edu only. Martin Ameskamp (ma@informatik.uni-kiel.de) wrote: |^^^^^^^^^^ | Right, this is exactly my question. I'm currently teaching a basic | course for 2nd year computing students that's mainly C++ and OOP | (with a few odd bits like make, lex & yacc thrown in). | Any hints for a good motivation would be greatly appreciated | (if none come, it's back to toy examples...) ^^^^^^^^^^ I don't know if this is considered a toy example. Last year, one of my friends asked me to teach him OOP. At that time we were following a course on laser physics, so I decided to use this as a basis for my explanations. When you are working with a laser beam, you can model the optical elements with 2*2 matrices and the beam at a certain position with a 1*2 matrix. When the beam propagates through an optical element, you multiply the beam column by the relevant matrix. We decided to implement a program that modelled a optical setup, using OOP. This was quite nice, because after we had designed our base class for optical elements, we could implement the optical elements independent of each other. Well, at least it's a working toy. Greetings, Jacob Sparre Andersen. -- URL's: "mailto:sparre@nbi.dk", "http://meyer.fys.ku.dk/~sparre", "mailto:sparre+@pitt.edu" & "http://www.pitt.edu/~sparre". -- "We need a plan to diverge from", Fesser