comp.lang.ada
 help / color / mirror / Atom feed
From: jmb36@bton.ac.uk (baker)
Subject: Using Arrays HELP!
Date: 1997/01/17
Date: 1997-01-17T00:00:00+00:00	[thread overview]
Message-ID: <5boab5$orc@saturn.brighton.ac.uk> (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.





                 reply	other threads:[~1997-01-17  0:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

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