AP Exam Vocab Flashcards
General Programming
What is a program?
a collection of program statements that performs a specific task when run by a computer
aka software
General Programming
What is a code segment?
collection of program statements that are part of a program
General Programming
What is a code statement?
a part of program code that expresses an action to be carried out
General Programming
What is an expression?
it consists of a value, a variable, an operator, or a procedure call that returns a value
General Programming
Is ‘if num> 10):’ an expression?
Yes, because it returns either True or False.
General Programming
What is program behavior?
- how a program functions when it is running
- often described by how a user interacts with it.
General Programming
What is program output?
- any data sent from a program to a device
Ex. tactile, audio, visual, or text
General Programming
What is an iterative development process?
- Iterative refers to repetition, so this process requires repeated refinement and revision based on feedback, testing, or reflection
- May involve revisiting earlier phases
General Programming
What is an incremental development process?
Increments refers to smaller segments, so this process involves breaking the problem into smaller pieces and making sure it works before adding it to the whole
General Programming
What is a simulation?
- representation that uses varying sets of values to reflect the changing state of a phenomenon
- real world models that abstract details away to get a simplified view → help learn about the world or predict events
- NOTE: may contain bias due to abstraction
Debugging
What is a syntax error, and provide an example.
- When rules of the programming language are not followed
- Ex. Incorrect parentheses, incorrect indentation, etc.
Debugging
What is a runtime error, and provide an example.
- When mistakes occur during the execution of a program
- Ex. Dividing by zero, index is out of bounds (going past the length or using a negative number depending on the language), etc.
- NOTE: programming languages define their own run-time errors
Debugging
What is a logical error?
- When the algorithm or program behave incorrectly or unexpectedly
- Hard to pick up on
Debugging
What is testing?
- Uses defined inputs to ensure that an algorithm/program is producing the expected outcomes
- Results from testing are used to revise algorithms/programs
Debugging
What is a comment?
a form of program documentation written into the program to be read by people and do not affect how a program runs
- Ex. In CMU, hashtags were used for this.
Debugging
What is program documentation?
a written description of the function of a code segment, event, procedure, or program and how it was developed
Procedural Abstraction
What is a procedure?
a named group of programming instructions that may have parameters and return values.
aka a function
Debugging
What are parameters?
input variables of a procedure
- Ex. For this function, drawLine(x1, y1, x2, y2), x1, y1, x2, y2 are parameters
Debugging
What are arguments?
- specify the values of the parameters when a procedure is called
- must be in the correct order of the parameters
and only use after they are defined - Ex. For this function, drawLine(x1, y1, x2, y2), 1, 5, 6, 5 are arguments
Debugging
What is program input?
- any data sent to a computer for processing by a program
Ex. tactile, audio, visual, or text
Debugging
What is modularity?
the subdivision of a computer program into separate subprograms
Data Abstraction
What is a variable?
- an abstraction inside a program that can hold a value, and each has associated data storage that represents one value at a time, but that value can be a list or other collection that in turn contains multiple values
- NOTE: Global variables are defined in to-level code, outside of any functions, can be used anywhere, but should be used lightly. Local variables can only be used in the function where they are defined.
Debugging
What is an event?
- associated with an action and supplies input data to a program
- Ex. onMousePress OR onEvent (“Home Button”)
Data Abstraction
What is an element?
- an individual value in a list that is assigned a unique index
Ex. For list = [“Jayla”, “Jayden”, “Jaylen”], “Jayla” is an element.