Dies ist eine alte Version des Dokuments!


LU05.A11 - v-if, v-else ... combined with AND/OR operators

  • Work type: Individual
  • Means of aid: only teaching materials, no websearch, no use of ai.
  • Timeframe: 20 Minutes
  • Expected result: A Vue script that displays HTML elements based on input values.
  1. Explaining the The directive v-if in your own word.
  2. Being able to apply v-if in combination with AND/OR operators

This assignment combines -vif with the using of local AND/OR-operators. That means that several rules must be obeyed in the if-clause.

  1. People under the age of 12 are not allowed to go to the cinema.
  2. Execute your script and check the result. Proceed only, if the result is correct.
  3. Under 12 and with adult company they are allowed to up to 6 o'clock pm.
  4. Execute your script and check the result. Proceed only, if the result is correct.
  5. Between 12 and 16 they are allowed up to 6 o'clock pm, even without an adult company.
  6. Execute your script and check the result. Proceed only, if the result is correct.
  7. Between 12 and 16 they may attend to screenings if they are accompanied by an adult.
  8. Execute your script and check the result. Proceed only, if the result is correct.
  9. Person older than 16 may go to the cinemas without time restriction.
  10. Execute your script and check the result. Proceed only, if the result is correct.
  11. Comment and save your script your results accordingly.

Hint To meet the requirements you need to use an additional variable hasAdult, which is from type bool.

English German
afterwards anschliessend
accordingly entsprechend

Volkan Demir

  • en/modul/m291/learningunits/lu05/aufgaben/12.1742279967.txt.gz
  • Zuletzt geändert: 2025/03/18 07:39
  • von vdemir