AP CSP Unit 4
If we call checkWeather, what is the maximum number of functions that can be called (including checkWeather)?
5
Comparison Operators
<, >, <=, >=, ==, != indicate a Boolean expression
Expression
A combination of operators and values that evaluates to a single value
Function Call
A command that executes the code within a function
Boolean Value
A data type that is either true or false.
Function
A named group of programming instructions. Also referred to as a "procedure".
Variable
A named reference to a value that can be used repeatedly throughout a program.
Assignment Operator
Allows a program to change the value represented by a variable
String
An ordered sequence of characters.
Allows a program to change the value represented by a variable
Assignment Operator
Which of the following are the argument(s) of the Label function call in circledText?
None of these
Arithmetic operator
Part of most programming languages and include addition, subtraction, multiplication, division, and modulus operators.
After using if, an elif can be added as an additional test.
True
Functions can help remove repeated code from a program
True
Relational operator
Used to test the relationship between two variables, expressions, or values.
code statement
a part of program code that expresses an action to be carried out.
Which of the following is a legal name for a function parameter?
apple3
specify the values of the parameters when a procedure is called
arguments
Part of most programming languages and include addition, subtraction, multiplication, division, and modulus operators.
arithmetic operator
Events
associated with an action and supplies input data to a program.
A data type that is either true or false.
boolean value
Which of the following correctly adds 4 to the centerX of a circle called c?
c.centerX += 4
Which of the following is the correct way to bring a circle named c to the front of the canvas?
c.toFront()
a part of program code that expresses an action to be carried out.
code statement
Which of the following are the parameter(s) of the function greet below?
color and labelSize
<, >, <=, >=, ==, != indicate a Boolean expression
comparison operators
Joins together two or more strings end-to-end to make a new string.
concatenation
Affect the sequential flow of control by executing different statements based on the value of a Boolean expression.
conditional statement
Program input
data sent to a computer for processing by a program. Input can come in a variety of forms, such as tactile, audio, visual, or text.
Expressions are _______________ to produce a single value.
evaluate
associated with an action and supplies input data to a program.
events
A combination of operators and values that evaluates to a single value
expression
A named group of programming instructions. Also referred to as a "procedure".
function
A command that executes the code within a function
function call
Which of the following is a valid call to the function g and will have f(x) be called 3 times?
g(4, 5)
Which of the following would be a legal function call for the given code below?
greet(30, 'pink')
Parameters
input variables of a procedure.
NOT, AND, and OR, which evaluate to a Boolean value.
logical operator
Which of the following is not a valid property of Circles?
none of these
input variables of a procedure.
parameters
data sent to a computer for processing by a program, can come in a variety of forms, such as tactile, audio, visual,text
program input
Used to test the relationship between two variables, expressions, or values.
relational operator
Determines which parts of an algorithm are executed based on a condition being true or false
selection
Arguments
specify the values of the parameters when a procedure is called.
An ordered sequence of characters.
string
uses defined inputs to ensure that an algorithm or program is producing the expected outcomes
testing
Testing
uses defined inputs to ensure that an algorithm or program is producing the expected outcomes. Programmers use the results to revise their algorithms or programs.
A named reference to a value that can be used repeatedly throughout a program.
variable
Evaluate
Expressions are _______________ to produce a single value.
Code in an else body runs if all the tests before it were True.
False
Functions are called once but can be declared many times
False
Programs written with functions run more quickly
False
Replacing repeated code with a function will reduce the number of commands the computer needs to run
False
The bodies of multiple elif's can run.
False
You can use an elif without an if.
False
Concatenation
Joins together two or more strings end-to-end to make a new string.
Logical operator
NOT, AND, and OR, which evaluate to a Boolean value.
Conditional Statement
Affect the sequential flow of control by executing different statements based on the value of a Boolean expression.
Selection
Determines which parts of an algorithm are executed based on a condition being true or false