Checkpoint 6.7.1.
What is a function in C++?
- A named sequence/group of statements that perform a particular task.
- Yes, a function is a named sequence of statements.
- Any sequence of statements.
- While functions contain sequences of statements, not all sequences of statements are considered functions.
- A mathematical expression that calculates a value.
- While some functions do calculate values, the python idea of a function is slightly different from the mathematical idea of a function in that not all functions calculate values. Consider, for example, the turtle functions in this section. They made the turtle draw a specific shape, rather than calculating a value.
- A statement of the form x = 5 + 4.
- This statement is called an assignment statement. It assigns the value on the right (9), to the name on the left (x).