AP Computer Science Principles Flashcards: Program Design And Development

Study Program Design And Development 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.

AP Computer Science Principles

Program Design And Development

0 mastered0 still learning

0% Complete

QUESTION
1/ 74

What is the difference between 'public' and 'private' access modifiers?

Tap card or press Space to flip

ANSWER

'public' is accessible everywhere; 'private' is within the same class. Controls visibility and access levels for class members.

How well did you know it?

Card 1 / 74

What this deck covers

This deck focuses on Program Design And Development, 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.

All flashcards

Flashcard 1: What is the difference between 'public' and 'private' access modifiers?

Answer: 'public' is accessible everywhere; 'private' is within the same class. Controls visibility and access levels for class members.

Flashcard 2: What is the purpose of a constructor in a class?

Answer: To initialize new objects. Special method that sets up object state when created.

Flashcard 3: What does 'MVC' stand for in software design?

Answer: Model-View-Controller. Architectural pattern separating presentation, logic, and data concerns.

Flashcard 4: Identify the error: 'while(x > 0); { x--; }'

Answer: Remove ';' after the condition. Semicolon creates empty loop body, preventing intended execution.

Flashcard 5: Identify the error: 'if (x = 10)'

Answer: Correct: 'if (x == 10)'. Single '=' assigns value; '==' compares for equality in conditions.

Flashcard 6: What is the difference between a class and an object?

Answer: Class is a blueprint; object is an instance. Template defines structure; instance contains actual data values.

Flashcard 7: What does 'DRY' stand for in programming?

Answer: Don't Repeat Yourself. Principle promoting code reusability by avoiding duplication.

Flashcard 8: Which keyword is used to inherit a class in Java?

Answer: extends. Establishes parent-child relationship between classes for code reuse.

Flashcard 9: What is a syntax error?

Answer: An error in the code's grammar or structure. Violates language rules preventing code from compiling or running.

Flashcard 10: Which programming construct is used for decision making?

Answer: Conditional statements. if-else and switch statements control program flow based on conditions.

Flashcard 11: Find and correct the error: 'int[] arr = new int(5);'

Answer: Correct: 'int[] arr = new int[5];'. Square brackets for arrays, not parentheses like method calls.

Flashcard 12: Identify the first step in the program development life cycle.

Answer: Problem analysis. Understanding requirements before designing solutions is essential first step.

Flashcard 13: What is abstraction in programming?

Answer: Hiding complex implementation details behind simple interfaces. Simplifies complexity by exposing only essential features to users.

Flashcard 14: What is a function's return type?

Answer: The data type of the value returned by the function. Specifies what kind of value the function sends back.

Flashcard 15: Identify the error: 'int x = 10; float y = x / 0;'

Answer: Division by zero error. Mathematical impossibility that causes runtime exception or undefined behavior.

Flashcard 16: What is the purpose of a loop in programming?

Answer: To repeat a block of code multiple times. Automates repetitive tasks by controlling iteration and flow.

Flashcard 17: Find and correct the error: 'int x = "100";'

Answer: Correct: 'int x = 100;'. String literal assigned to integer variable causes type mismatch.

Flashcard 18: Find and correct the error: 'int[] arr = new int(5);'

Answer: Correct: 'int[] arr = new int[5];'. Square brackets for arrays, not parentheses like method calls.

Flashcard 19: Identify the error: 'switch(x) { case 1: x+=1; break; default: x-=1; }'

Answer: No error. Proper switch syntax with break statements and default case.

Flashcard 20: What is abstraction in programming?

Answer: Hiding complex implementation details behind simple interfaces. Simplifies complexity by exposing only essential features to users.

Flashcard 21: Identify the error: 'while(x > 0); { x--; }'

Answer: Remove ';' after the condition. Semicolon creates empty loop body, preventing intended execution.

Flashcard 22: What is an IDE?

Answer: Integrated Development Environment. Software providing comprehensive tools for coding, debugging, and testing.

Flashcard 23: What is the difference between '==' and 'equals()' in Java?

Answer: '==' checks reference equality; 'equals()' checks value equality. Reference vs content comparison for determining object equality.

Flashcard 24: Which structure is used to handle exceptions in Java?

Answer: try-catch block. Catches and manages runtime errors gracefully without crashing.

Flashcard 25: Which method is the entry point for a Java application?

Answer: main method. Starting point where JVM begins program execution.

Flashcard 26: What is encapsulation in object-oriented programming?

Answer: Bundling data with methods that operate on the data. Data hiding principle combining related data and functions together.

Flashcard 27: What is an IDE?

Answer: Integrated Development Environment. Software providing comprehensive tools for coding, debugging, and testing.

Flashcard 28: What is polymorphism in programming?

Answer: Ability of different classes to respond to the same method call. Same interface produces different behaviors in different classes.

Flashcard 29: Find and correct the error: 'for(int i = 0; i < 10; i+)'

Answer: Correct: 'for(int i = 0; i < 10; i++)'. Missing second '+' in increment operator; should be 'i++'.

Flashcard 30: What is the purpose of version control in software development?

Answer: To manage changes to source code over time. Tracks modifications, enables collaboration, and maintains code history.

Flashcard 31: Identify the error: 'switch(x) { case 1: x+=1; break; default: x-=1; }'

Answer: No error. Proper switch syntax with break statements and default case.

Flashcard 32: What is the difference between '==' and 'equals()' in Java?

Answer: '==' checks reference equality; 'equals()' checks value equality. Reference vs content comparison for determining object equality.

Flashcard 33: What is a software design pattern?

Answer: A reusable solution to a common problem. Template providing proven structure for recurring design challenges.

Flashcard 34: What is inheritance in object-oriented programming?

Answer: Mechanism for one class to inherit attributes and methods from another. Child classes acquire properties and behaviors from parent classes.

Flashcard 35: What is the role of an algorithm in program design?

Answer: To outline the step-by-step solution to a problem. Provides clear, logical sequence of instructions to solve problems.

Flashcard 36: What is polymorphism in programming?

Answer: Ability of different classes to respond to the same method call. Same interface produces different behaviors in different classes.

Flashcard 37: Which loop executes at least once regardless of condition?

Answer: Do-while loop. Condition checked after execution, guaranteeing minimum one iteration.

Flashcard 38: What is a function's return type?

Answer: The data type of the value returned by the function. Specifies what kind of value the function sends back.

Flashcard 39: Identify the error: 'if (x > y) x = 10; else; y = 10;'

Answer: Remove ';' after else. Semicolon after else creates syntax error in conditional structure.

Flashcard 40: Which programming construct is used for decision making?

Answer: Conditional statements. if-else and switch statements control program flow based on conditions.

Flashcard 41: What is the primary purpose of program documentation?

Answer: To explain code logic and facilitate future maintenance. Comments and structure make code understandable for others and future edits.

Flashcard 42: What is the purpose of version control in software development?

Answer: To manage changes to source code over time. Tracks modifications, enables collaboration, and maintains code history.

Flashcard 43: What does 'MVC' stand for in software design?

Answer: Model-View-Controller. Architectural pattern separating presentation, logic, and data concerns.

Flashcard 44: What is a software design pattern?

Answer: A reusable solution to a common problem. Template providing proven structure for recurring design challenges.

Flashcard 45: Which data structure uses LIFO order?

Answer: Stack. Last In, First Out - elements added/removed from same end.

Flashcard 46: What is the purpose of a loop in programming?

Answer: To repeat a block of code multiple times. Automates repetitive tasks by controlling iteration and flow.

Flashcard 47: Identify the error: 'if (x = 10)'

Answer: Correct: 'if (x == 10)'. Single '=' assigns value; '==' compares for equality in conditions.

Flashcard 48: Find and correct the error: 'for(int i = 0; i < 10; i+)'

Answer: Correct: 'for(int i = 0; i < 10; i++)'. Missing second '+' in increment operator; should be 'i++'.

Flashcard 49: What is inheritance in object-oriented programming?

Answer: Mechanism for one class to inherit attributes and methods from another. Child classes acquire properties and behaviors from parent classes.

Flashcard 50: Which loop executes at least once regardless of condition?

Answer: Do-while loop. Condition checked after execution, guaranteeing minimum one iteration.

Flashcard 51: What is a variable's scope?

Answer: The region of code where the variable is accessible. Determines where variables can be accessed within program structure.

Flashcard 52: Identify the error: 'if (x > y) x = 10; else; y = 10;'

Answer: Remove ';' after else. Semicolon after else creates syntax error in conditional structure.

Flashcard 53: What is the role of an algorithm in program design?

Answer: To outline the step-by-step solution to a problem. Provides clear, logical sequence of instructions to solve problems.

Flashcard 54: Which data structure uses LIFO order?

Answer: Stack. Last In, First Out - elements added/removed from same end.

Flashcard 55: Find and correct the error: 'int x = "100";'

Answer: Correct: 'int x = 100;'. String literal assigned to integer variable causes type mismatch.

Flashcard 56: What is a syntax error?

Answer: An error in the code's grammar or structure. Violates language rules preventing code from compiling or running.

Flashcard 57: What is a recursive function?

Answer: A function that calls itself. Solves problems by breaking them into smaller identical subproblems.

Flashcard 58: Which structure is used to handle exceptions in Java?

Answer: try-catch block. Catches and manages runtime errors gracefully without crashing.

Flashcard 59: What is encapsulation in object-oriented programming?

Answer: Bundling data with methods that operate on the data. Data hiding principle combining related data and functions together.

Flashcard 60: What is the function of a compiler?

Answer: To convert source code into machine code. Translates high-level code into executable machine instructions.

Flashcard 61: What is the purpose of a constructor in a class?

Answer: To initialize new objects. Special method that sets up object state when created.

Flashcard 62: Which method is the entry point for a Java application?

Answer: main method. Starting point where JVM begins program execution.

Flashcard 63: What is the function of a compiler?

Answer: To convert source code into machine code. Translates high-level code into executable machine instructions.

Flashcard 64: What is a recursive function?

Answer: A function that calls itself. Solves problems by breaking them into smaller identical subproblems.

Flashcard 65: What is a variable's scope?

Answer: The region of code where the variable is accessible. Determines where variables can be accessed within program structure.

Flashcard 66: What is the difference between 'public' and 'private' access modifiers?

Answer: 'public' is accessible everywhere; 'private' is within the same class. Controls visibility and access levels for class members.

Flashcard 67: What is an API?

Answer: Application Programming Interface. Interface defining how software components communicate and interact.

Flashcard 68: Which keyword is used to inherit a class in Java?

Answer: extends. Establishes parent-child relationship between classes for code reuse.

Flashcard 69: What is the primary purpose of program documentation?

Answer: To explain code logic and facilitate future maintenance. Comments and structure make code understandable for others and future edits.

Flashcard 70: Identify the first step in the program development life cycle.

Answer: Problem analysis. Understanding requirements before designing solutions is essential first step.

Flashcard 71: What does 'DRY' stand for in programming?

Answer: Don't Repeat Yourself. Principle promoting code reusability by avoiding duplication.

Flashcard 72: What is the difference between a class and an object?

Answer: Class is a blueprint; object is an instance. Template defines structure; instance contains actual data values.

Flashcard 73: What is an API?

Answer: Application Programming Interface. Interface defining how software components communicate and interact.

Flashcard 74: Identify the error: 'int x = 10; float y = x / 0;'

Answer: Division by zero error. Mathematical impossibility that causes runtime exception or undefined behavior.