AP Computer Science Principles Flashcards: Developing Procedures

Study Developing Procedures in AP Computer Science Principles with focused flashcards that help you recognize the idea, recall the key rule, and apply it in practice-style prompts.

QUESTION

What is an argument in procedures?

Tap card or press Space to flip

ANSWER

Value passed to a procedure's parameter. The actual data passed to parameters when calling.

1 / 36

AP Computer Science Principles: Algorithms and Programming

All flashcards

36 cards

What this deck covers

This deck focuses on Developing Procedures, giving you a quick way to review the definitions, rules, and examples that matter most for AP Computer Science Principles.

How to use these flashcards

Work through these flashcards in short sessions. Try to answer each prompt before flipping the card, then revisit any cards you miss until the explanation feels automatic.

Practice questions

1 of 16Practice questions for this set
Based on the scenario, a student writes a procedure to find the maximum value in a non-empty list of integers. Input: list nums (length 1 to 50,000). Output: the largest integer in the list. Constraint: must work for negative numbers.
PROCEDURE maxValue(nums)
  max ← 0
  FOR EACH n IN nums
    IF n > max
      max ← n
    ENDIF
  ENDFOR
  RETURN max
ENDPROCEDURE
Which step is necessary to ensure the procedure works correctly for all valid inputs?
Choose an answer

Keep your progress across every deck

Free account · cards you mark are saved to it