Podcast
Questions and Answers
Which of the following best describes the difference between mathematical functions and functions in programming languages?
Which of the following best describes the difference between mathematical functions and functions in programming languages?
- Mathematical functions remember a state and produce another value next time they are called, while functions in programming languages always produce the same return value.
- Mathematical functions are subroutines that return values given certain parameters, while functions in programming languages are defined as relations between elements in a definition set and elements in a value set.
- Mathematical functions are defined as relations between elements in a definition set and elements in a value set, while functions in programming languages are subroutines that return values given certain parameters. (correct)
- Mathematical functions and functions in programming languages are the same, just called by different names.
What is the main requirement for a mathematical function?
What is the main requirement for a mathematical function?
- There must be multiple output values for each input value.
- The output value can change every time the function is called.
- There is no requirement for a mathematical function.
- There must be exactly one output value for each input value. (correct)
What is one feature of functions in most programming languages that is different from mathematical functions?
What is one feature of functions in most programming languages that is different from mathematical functions?
- Functions in programming languages may produce different return values each time they are called. (correct)
- Functions in programming languages always produce the same return value.
- Functions in programming languages cannot have parameters.
- Functions in programming languages can only be called once.
Which programming language is mentioned as an example of a language that has borrowed the concept of functions from mathematics?
Which programming language is mentioned as an example of a language that has borrowed the concept of functions from mathematics?
What is the purpose of mathematical functions in programming languages?
What is the purpose of mathematical functions in programming languages?