Post #165,349
7/21/04 11:21:30 AM
|
Looking for programming problem ideas - first OO C++ program
For my victims - er class.
It needs to be something a pro could write in an hour. We're talking 1-5 pages of code max. Last assignment introduced streams, structs, and an internally linked list by implementing a phone book that supported add, list, delete, find, save, and load via a command line menu.
Now I want to introduce classes (actually ADT - no inheritance yet) and am coming up dry for ideas.
That was lovely cheese.
--Wallace, The Wrong Trousers
|
Post #165,352
7/21/04 11:32:04 AM
|
Turn the phone book into a mini-CRM app?
...maybe a Customer class which owns an ordered set of Conversation objects.
|
Post #165,407
7/21/04 2:27:29 PM
|
How 'bout...
... the underlying data store for a Football Pool (that's American Football for you, Peter). Define a Team class that contains such nonsense as their name, their logo, etc. Then another class for a Game; contains two pointers to the Teams that are playing each other, which one's the home team, which one is favored by how much, etc. Finally a GameWeek class, which is a container for the Games that are to be played in a given week.
No inheretance, but lots of aggregation. Once done, you can then use this store to display a list of the week's Games in HTML or something, using the Game's Render() method, which would call the Team's Render method for rendering the logos....
Might be fun. Note that there should be the standard disclaimer that this is "for educational purposes only...blah, blah, blah...".
jb4 shrub\ufffdbish (Am., from shrub + rubbish, after the derisive name for America's 43 president; 2003) n. 1. a form of nonsensical political doubletalk wherein the speaker attempts to defend the indefensible by lying, obfuscation, or otherwise misstating the facts; GIBBERISH. 2. any of a collection of utterances from America's putative 43rd president. cf. BULLSHIT
|
Post #165,408
7/21/04 2:35:37 PM
|
Baseball!
Then you have context-dependence like designated hitter.
-drl
|
Post #165,449
7/21/04 5:23:10 PM
7/21/04 5:24:03 PM
|
Source of project ideas
They've been collecting [link|http://nifty.stanford.edu|nifty ideas here] for a while.
Worth poking through....
(BTW, congrats on the new gig! Hope everything works well for you.)
Tom Sinclair
"While I'm still confused and uncertain, it's on a much higher plane, d'you see, and at least I know I'm bewildered about the really fundamental and important facts of the universe." Treatle nodded. "I hadn't looked at it like that," he said, "But you're absolutely right. He's really pushed back the boundaries of ignorance." -- Discworld scientists at work (Terry Pratchett, Equal Rites)
Edited by tjsinclair
July 21, 2004, 05:24:03 PM EDT
|
Post #165,484
7/21/04 10:18:21 PM
|
Those are kind of cool
I made them write a Fraction object though.
There was much consternation in class to learn that 99/100 == 0. (due to int truncation). So I wrote an Int class that faithfully mimics a builtin int, but operator/ returns a Fraction. They have to write the fraction (retains numerator and denominator). I helped them out by writing the reduce method and ctors.
Good ADT and type management exercise. I gave them a test program that has to work that exercises all sorts of type conversions. They'll be in ambiguity hell for hours I'll bet. Writing a new type is freakin hard (and generally not quite possible in C++ without making some compromises).
That was lovely cheese.
--Wallace, The Wrong Trousers
|
Post #165,511
7/22/04 12:55:00 AM
|
Glad you liked them
I'm always on the look-out for interesting (but doable) programming problems for my students.
Tom Sinclair
"While I'm still confused and uncertain, it's on a much higher plane, d'you see, and at least I know I'm bewildered about the really fundamental and important facts of the universe." Treatle nodded. "I hadn't looked at it like that," he said, "But you're absolutely right. He's really pushed back the boundaries of ignorance." -- Discworld scientists at work (Terry Pratchett, Equal Rites)
|
Post #165,518
7/22/04 1:41:57 AM
|
You're welcome to mine
[link|http://carbon.cudenver.edu/~tblancha/csc1410|http://carbon.cudenv...~tblancha/csc1410]
Don't know how long it will stay up there after the summer ends.
That was lovely cheese.
--Wallace, The Wrong Trousers
|
Post #165,563
7/22/04 11:15:14 AM
|
Thanks, I'll snag them right now
Tom Sinclair
"While I'm still confused and uncertain, it's on a much higher plane, d'you see, and at least I know I'm bewildered about the really fundamental and important facts of the universe." Treatle nodded. "I hadn't looked at it like that," he said, "But you're absolutely right. He's really pushed back the boundaries of ignorance." -- Discworld scientists at work (Terry Pratchett, Equal Rites)
|
Post #165,695
7/22/04 11:21:53 PM
|
Might wait until class is over on the 7th - more to come
That was lovely cheese.
--Wallace, The Wrong Trousers
|
Post #165,548
7/22/04 10:49:41 AM
|
I remember a book from my days in Russia
[link|http://www.amazon.com/exec/obidos/tg/detail/-/0132918072/qid=1090507342/sr=8-1/ref=sr_8_xs_ap_i1_xgl14/104-8975062-2015963?v=glance&s=books&n=507846|Etudes for Programmers]
It was translated, and the problems were very interesting and quite doable (if I had a computer at my disposal). The Game of Life on infinite field was one of the simpler ones. Self-printing program was quite interesting (I did it in SNOBOL, but I don't know how tro do it in C).
Of course, time and experience have altered my perception. May be the book is not so good, and it's nostalgia spaeking. Still, take a look.
--
"...was poorly, lugubrious and intoxicated."
-- Patrick O'Brian, "Master and Commander"
|