zuai-logo
zuai-logo
  1. AP Computer Science Principles
FlashcardFlashcardStudy GuideStudy GuideQuestion BankQuestion BankGlossaryGlossary

Glossary

A

AP Pseudocode

Criticality: 2

A standardized, language-independent notation used in the AP Computer Science Principles exam to represent algorithms and programming concepts.

Example:

The structure PROCEDURE example(val) { RETURN val * 2 } is written in AP Pseudocode.

Arguments

Criticality: 3

The actual values or expressions passed to a procedure when it is called, which are assigned to the corresponding parameters.

Example:

When you call calculate_discount(100, 0.15), 100 and 0.15 are the arguments being sent to the procedure.

C

Calling a Procedure

Criticality: 3

The action of executing the code defined within a procedure by referencing its name and providing any required arguments.

Example:

After defining a procedure display_greeting(), you perform calling a procedure by simply writing display_greeting() in your code.

P

Parameters

Criticality: 3

Variables listed in a procedure's definition that act as placeholders for the input values the procedure expects to receive.

Example:

In PROCEDURE calculate_discount(price, percentage), price and percentage are the parameters that define what information the procedure needs.

Procedure

Criticality: 3

A self-contained block of code designed to perform a specific task, often referred to as a method or function in different programming languages.

Example:

You could create a procedure called draw_square that contains all the steps to draw a square, making your main program cleaner.

R

RETURN Statement

Criticality: 3

A command used within a procedure to specify the value that the procedure will send back to the calling program and to terminate the procedure's execution.

Example:

Inside a procedure that finds the maximum of two numbers, RETURN max_num would send the largest number back to where the procedure was called.

Return Value

Criticality: 3

The result or output that a procedure sends back to the part of the program that called it after completing its execution.

Example:

A procedure that converts Fahrenheit to Celsius would have the calculated Celsius temperature as its return value.

Reusability

Criticality: 2

The principle of writing code once and being able to use it multiple times throughout a program or in different programs, often achieved through procedures.

Example:

Instead of writing the same complex calculation three times, you can put it into a single procedure, demonstrating excellent code reusability.

V

Variable Scope

Criticality: 2

The region of a program where a variable is accessible and can be used, typically limited to the block of code where it was defined.

Example:

A variable declared inside a procedure has a local variable scope, meaning it cannot be directly accessed or modified from outside that procedure.