From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=0.6 required=5.0 tests=BAYES_40,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f72a01e6d51380b6,start X-Google-Attributes: gid103376,public From: jmb36@bton.ac.uk (baker) Subject: Using Arrays HELP! Date: 1997/01/17 Message-ID: <5boab5$orc@saturn.brighton.ac.uk>#1/1 X-Deja-AN: 210454089 organization: University of Brighton newsgroups: comp.lang.ada Date: 1997-01-17T00:00:00+00:00 List-Id: 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.