Activity : Logical Functions
  People travelling to some countries are advised that they should be vaccinated against certain diseases.

For one such disease, travelling to some countries is considered to be medium risk, travelling to other countries is considered to be low risk, and travel to all other countries is considered to be of no risk at all.

The age of the traveller is also important, with very young or elderly people being at different levels of risk.

There are two types of vaccination (A and B) which are suitable in different circumstances.

The algorithm shown below is used to determine whether the traveller should be vaccinated.

Statement
1 input CountryRisk
2 input Age
3 if ((CountryRisk = medium) AND (Age > 70))
4   then output "Vaccinate with A"
5   else if (((CountryRisk=medium) AND (Age < 5)) OR
     ((CountryRisk=low) AND (Age > 70)))
6     then output "Vaccinate with B"
7     else output "Do not vaccinate"

 

 
 

Write down the output for a traveller aged 72 travelling to a low risk country.

Write down the output for a traveller aged 4 travelling to a low risk country.

Write down the output for a traveller aged 35 travelling to a medium risk country.

Write down the output for a traveller aged 72 travelling to a medium risk country.

   Back