Count the values a definition permits

An access-control program uses the following finite data definitions:

  • Grant has two fields: level, either viewer or editor; and expiry, either one day, one week, or one month.
  • Decision is either Deny, which has no fields, or Allow(grant), which contains one Grant.
  • AuditRequest has two fields: decision, containing one Decision; and urgent, either true or false.

All combinations of the permitted field values are allowed. Two values are distinct if their forms differ or at least one field differs. There are no other fields or restrictions.


Complete the table with the exact integer number of distinct values permitted by each definition.

Data definitionNumber of distinct values
Grant
Decision
AuditRequest

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Data Definitions and Program Structure Questions: