comp.lang.ada
 help / color / mirror / Atom feed
* [Q] Ada Archive?
@ 1995-03-06 14:54 Kelvin Pope
  1995-03-08  7:10 ` Bob Kitzberger
  1995-03-08 15:55 ` Robert Dewar
  0 siblings, 2 replies; 3+ messages in thread
From: Kelvin Pope @ 1995-03-06 14:54 UTC (permalink / raw)


Dear All,

I hope one of you lovely people can help me.

I am looking for an Ada program that will tell me when I have had 
too much alchohol to be legally able to drive.  It's sort of an office 
joke, you know the sort of thing.

What I was wondering is there is an Ada archive anywhere that I 
can pick up an example of this sort of program,  each drink has a 
number of units of alchohol, max legal level etc.

If no such mecca exists, would one of you kind souls put us out of 
our misery so to speak and consider giving us a hand with the said 
problem.

All donations gratefully received!!

Thanks,

Kelvin.

P.S.  I'm not a student on the scrounge, just a bored Network 
Technician in need of help!!




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Q] Ada Archive?
  1995-03-06 14:54 [Q] Ada Archive? Kelvin Pope
@ 1995-03-08  7:10 ` Bob Kitzberger
  1995-03-08 15:55 ` Robert Dewar
  1 sibling, 0 replies; 3+ messages in thread
From: Bob Kitzberger @ 1995-03-08  7:10 UTC (permalink / raw)


Kelvin Pope (ccfk0@susx.ac.uk) wrote:

: What I was wondering is there is an Ada archive anywhere that I 
: can pick up an example of this sort of program,  each drink has a 
: number of units of alchohol, max legal level etc.

Oh, this is much to vague.  Don't touch that whizzy development 
environment until you fully analyze the problem domain (unless
that whizzy development environment includes Rose, in which
case, you get to avoid paper and pencil from the git-go).

;-)

Let's see, we have several classes to describe before we get to
the implementation:

Person
  subclass Drinker
  attributes: weight, age, timeline for amount consumed

Drink
  attributes: percentage of alcohol, quantity of drink

Country 
  attributes: legal age to drink; max legal level of alcohol in blood

Turn on the stereo, perhaps the Brandenburg Concertos.
Then, flesh out the domain classes.  Then, have a Belgian beer and consider
what to do next.   You decide on implementing these classes in a 
simple way, leading to your first successful prototype.  Then,
have another beer and decide what to do next.  "Identify risk areas"
you mutter to yourself, and off you go...

If the beer wasn't too strong, you'd probably realize that the 
only thing of any difficulty in this is the amount consumed / 
rate of decay.  Decide on investigating this aspect
further.  Create implementation classes for this and include a 
reference from the Drinker class to this new timeline/decay Class.
Have another beer.  Implement  your second prototype.  Congratulate
yourself for making progress so quickly.

Have another beer.  Wander over to the stereo and change the CD
to something more in the mood, maybe some Hendrix or Stevie Ray Vaughn.  
Back in front of the computer; pop another beer.  Decide that
it would be very cool if each drink was its own subclass of drink,
and start cataloguing every drink out of your "Pocket Bartender's
Guide".  Have a slightly muddled epiphany that you really should
create a class for each _kind_ of alcohol (vodka, tequila, etc.) 
and the individual drink classes should each multiply inherit
from all relevant Alcohol classes.  Ooh, this is going to be
a bit rough, so you have another beer.  Draw a few of the hundreds
of new class relationships needed, put that on the back burner
when you think "persistence!  that's what's missing!".  Change
the CD to Kraftwerk.  Start your PPP connection, ask the
people on comp.object for recommendations on a good OODBMS
to use to keep track of all of those persistent objects.  Make many
many typos in your posting; everyone ignores it.    Fall
asleep on the keyboard.  

--
Bob Kitzberger	        +1 (916) 274-3075	        rlk@rational.com
Rational Software Corp., 10565 Brunswick Rd. #11, Grass Valley, CA 95945



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Q] Ada Archive?
  1995-03-06 14:54 [Q] Ada Archive? Kelvin Pope
  1995-03-08  7:10 ` Bob Kitzberger
@ 1995-03-08 15:55 ` Robert Dewar
  1 sibling, 0 replies; 3+ messages in thread
From: Robert Dewar @ 1995-03-08 15:55 UTC (permalink / raw)


Hmm! Kelvin, this sounds a very trivial program, it also sounds just like
the sort of problem that gets assigned in beginning programming courses.
Maybe you should reassure us ... :-)




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~1995-03-08 15:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1995-03-06 14:54 [Q] Ada Archive? Kelvin Pope
1995-03-08  7:10 ` Bob Kitzberger
1995-03-08 15:55 ` Robert Dewar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox