Lesson 4.12.1.1
4.12.1.1 Function types and first-class objects Quiz: AQA Computer Science, Unit 12
20 questions
In partnership with Revision Ninja
Lesson 4.12.1.1, Function types and first-class objects: 20 multiple choice questions for the AQA Computer Science (7517), Unit 12: Fundamentals of functional programming, written with Revision Ninja.
Host it live on the board and students join with a game code on their own devices, or revise alone with Free Play. The answers are revealed in the game.
The 20 questions
-
In the function type signature f: A -> B, what term is given to set A?
- Co-domain
- Domain
- Range
- Cartesian product
-
In the function type signature f: A -> B, what term is given to set B?
- Argument type
- Range
- Domain
- Co-domain
-
In functional programming, what does the expression f: A -> B declare?
- Function type
- Function application
- Lambda expression
- Function composition
-
What term describes the set from which all potential output values of a function are chosen?
- Range
- Co-domain
- Domain
- Cartesian product
-
For a function f: {a..z} -> {0..25}, what is the domain of f?
- Empty set
- Set {0..25}
- Set of integers
- Set {a..z}
-
A function has the type signature Integer x Integer -> Integer. What is its argument type?
- Single Integer
- Cartesian product
- Integer array
- Boolean tuple
-
What term refers to the process of passing an argument to a function to calculate its result?
- Type inference
- Partial evaluation
- Function composition
- Function application
-
What is the type of the function f(x) = x + 2 on the integers?
- integer -> integer
- string -> integer
- integer x integer -> integer
- real -> boolean
-
Which construct in functional programming can be passed as an argument and returned from functions?
- First-class object
- Control structure
- Syntax keyword
- Compiler directive
-
Why is a function considered a first-class object in functional programming?
- Has global scope
- Passable as argument
- Modifies shared memory
- Runs in parallel
-
Which basic data type is treated as a first-class object in almost all programming languages?
- Import statement
- Class declaration
- Integer
- While loop
-
For the function f: Integer -> Boolean defined by f(x) = x > 0, what is the co-domain?
- Boolean
- Integer
- String
- Real
-
A function g maps days of the week to the integers 1 to 7. What is the domain?
- Boolean values
- Real numbers
- Integers 1 to 7
- Days of week
-
What term describes the set of co-domain values actually produced by applying a function?
- Type signature
- Cartesian product
- Range
- Domain
-
For a function with type string -> integer, what is the output data type?
- String
- Boolean
- Integer
- Float
-
How many outputs in set B does a function f: A -> B assign to each element in set A?
- Two or more
- At least one
- Exactly one
- Zero or more
-
A function f: {1,2,3} -> {0,...,6} is defined by f(x) = 2x. Which set is the set of outputs actually produced?
- {2, 4, 6, 8}
- {1, 2, 3}
- {0, 1, 2, 3, 4, 5, 6}
- {2, 4, 6}
-
A function reads a character and returns its position in the alphabet. What is its type?
- char -> integer
- char x char -> integer
- string -> string
- integer -> char
-
In the function type definition f: A -> B, what set is represented by B?
- Input set
- Co-domain
- Domain
- Argument type
-
What term describes a function that can be passed as an argument or returned from another function?
- Partial function
- Curried procedure
- Higher-order statement
- First-class object
Related quizzes
- Partial function application and composition of functions Quiz · 4.12.1.4 · 20 questions
- Writing functional programs Quiz · 4.12.2.1 · 20 questions
- List processing Quiz · 4.12.3.1 · 20 questions
- Data types Quiz · 4.1.1.1 · 20 questions
- Entity relationship modelling Quiz · 4.10.1.1 · 20 questions
- Big Data Quiz · 4.11.1.1 · 20 questions
- Analysis Quiz · 4.13.1.1 · 20 questions
- Data structures and abstract data types Quiz · 4.2.1.1 · 20 questions
- Breadth-first and depth-first search Quiz · 4.3.1.1 · 20 questions
- Problem-solving and algorithms Quiz · 4.4.1.1 · 20 questions