comp.lang.ada
 help / color / mirror / Atom feed
* Using Arrays HELP!
@ 1997-01-17  0:00 baker
  0 siblings, 0 replies; only message in thread
From: baker @ 1997-01-17  0:00 UTC (permalink / raw)



I am writing a program to work out the number of units of alcohol from
entering certain drinks, in certain amounts. Using the CASE statement, how
can I assign the arrays below (assuming they are correct) to a float
variable for the total ABV?

type beverage is (beer, strong_beer, wine, fortified_wine, spirits);
type beverage_strength is array (beverage) of float;
type beverage_size1 is array (beverage) of integer;

mix_component: constant beverage_strength:=(beer=>3.5, strong_beer=>5.0,
                                            wine=>12.0, fortified_wine=>
                                            18.0, spirits=>40.0)

glass_size_pub: constant beverage_size1:=(beer=>568, strong_beer=>568,        
                                          wine=>125, fortified_wine=>50, 
                                          spirits=>24)

For example, if the user entered "beer" in the case statement, how do I
assign the total ABV of 3.5 in a 568ml glass in a variable called 
abv_total?

If anyone can help me, could you please E-Mail me at: J.M.Baker@bton.ac.uk

Thank you.





^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~1997-01-17  0:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-01-17  0:00 Using Arrays HELP! baker

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