jeudi 28 avril 2016

How to have multiple conditionals in an if statement in Ada

How would I go about having multiple conditionals in an if statement?

Eg. The user is asked a set of questions by the program:

1.) Enter an altitude between 0 and 1000

(user types in data)

2.) Enter Velocity between 0 and 500

(user types in data)

3.) Enter Temperature between 0 and 200

(user types in data)

the program then prints back

  1. altitude = user value
  2. velocity = user value
  3. temperature = user value //ignore those list numbers

I have set in my (.ads) file that each of these ranges has a criticle value.

I want to create an if statement that has multiple conditionals. in pseudo : If velocity = critical velocity & temperature = critical temperature & altitude = critical altitude then print ("some message") else do nothing

Aucun commentaire:

Enregistrer un commentaire