QUESTION IMAGE
Question
question: 10
the ap exam uses the following relational (comparison) operators: =, #, >, <, 2, and s.
as well, and, or and not are used instead of and, or and not.
a county 911 system uses an automated computer program to dispatch one of two ambulances. in order to dispatch the ambulance, the ambulance needs to be available and the emergency needs to be in the ambulances primary zone or the other ambulance is not available.
the following boolean variables are used:
amboneavail - set to true if ambulance one is available, otherwise set to false
ambtwoavail - set to true if ambulance two is available, otherwise set to false
inzone - set to true if the emergency is in the primary zone for the ambulance, otherwise set to false
which of the following boolean expressions can be used in a selection statement to cause ambulance one to be dispatched?
Step1: Analyze the problem requirements
The ambulance one is dispatched when two conditions are met: ambulance one is available (ambOneAvail is true) and (the emergency is in its primary zone (inZone is true) or the other ambulance (ambTwoAvail) is not available (NOT ambTwoAvail is true)).
Step2: Check each option
- For the option "ambOneAvail AND (inZone OR NOT ambTwoAvail)":
- If ambOneAvail is true (ambulance one is available) and (either inZone is true (emergency in its zone) or ambTwoAvail is false (other ambulance not available)), this meets the dispatch condition.
- For the option "ambOneAvail AND (inZone OR ambTwoAvail)":
- If ambTwoAvail is true (other ambulance is available), this does not meet the "other ambulance is not available" part of the dispatch condition.
- For the option "ambOneAvail OR (inZone OR ambTwoAvail)":
- The OR operator here is incorrect. The availability of ambulance one is a must - have (AND with the other part), not an alternative.
- For the option "NOT ambTwoAvail AND (inZone OR ambOneAvail)":
- The main condition should start with the availability of ambulance one (ambOneAvail), not the non - availability of ambulance two.
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
ambOneAvail AND (inZone OR NOT ambTwoAvail)