[Tutor] Code critique please (OOP strategy)
Sun, 30 Dec 2001 20:30:43 -0600 (CST)
I've done an object-oriented version of the stock portfolio tracking
program I assigned to my students
(http://www.isd197.org/sibley/cs/icp/assignments/portfolio_html). I plan
to use this for comparison when we introduce OOP after the Winter Break.
My version is available at http://www.qwerk.org/tim/
I'd like to get some feedback on the code. I've created two classes
here, Portfolio and Stock. I'm specifically interested in the way the
main() function interacts with the class methods. I've got a strange mix
of program logic stuck in a series of elif statements and in the class
methods themselves. Something doesn't seem right about it.
Is there a way to create a Menu class that would help?
Tim Wilson | Visit Sibley online: | Check out:
Henry Sibley HS | http://www.isd197.org | http://www.zope.com
W. St. Paul, MN | | http://slashdot.org
firstname.lastname@example.org | <dtml-var pithy_quote> | http://linux.com