Unit 3: Boolean Expressions and if Statements Flashcards

1
Q

! (NOT) Operator

A

A unary operator that negates the value of a boolean expression. It returns true if the expression is false, and false if the expression is true.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

&& (AND) operator

A

A logical operator that returns true if both of its operands are true, and false otherwise.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

|| (OR) operator

A

A logical operator that returns true if at least one of its operands is true, and false otherwise.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Boolean Expressions

A

Statements that evaluate to either true or false. They are commonly used in programming to make decisions and control the flow of a program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Boolean Logic Operators

A

Symbols used to perform logical operations on boolean values (true or false). They allow programmers to combine conditions and make decisions based on the result.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Boolean Statements

A

Expressions that can only have two possible values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Boolean values

A

Data types that can only have two possible values - true or false. They are often used in programming to make decisions based on certain conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Branching

A

Refers to the ability of a program to make decisions and execute different sets of instructions based on certain conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Branching Decisions

A

Refer to the process in programming where different paths are taken based on certain conditions or criteria. It allows the program to make decisions and execute specific blocks of code accordingly.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

College Board

A

An organization that administers standardized tests, including the AP Computer Science A exam. They set the curriculum and create the exams for various subjects.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Combinational Logic

A

Refers to digital circuits where the output depends solely on the current input values. There is no memory element involved in these circuits.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Comparing Objects

A

Involves checking whether two objects are equal or determining their relative order. In computer science, it is done using comparison operators or methods to compare the values of specific attributes or properties.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Compound boolean statements

A

Logical expressions that combine multiple boolean values using logical operators such as AND, OR, and NOT. They allow us to evaluate the truth or falsehood of complex conditions.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Conditional Statements

A

Programming constructs that allow different actions to be taken based on whether a certain condition is true or false. They control the flow of execution in a program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Efficient

A

Achieving maximum productivity with minimum wasted effort or resources. In computer science, it refers to writing code that performs tasks quickly and uses minimal memory.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Equivalent Boolean Expressions

A

Different logical expressions that produce the same output for all possible input combinations. In other words, they have the same truth table.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Exam Weighting

A

Refers to the allocation of points or marks given to each section or topic in an exam. It determines how much each part contributes to the overall score.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Flow of Program

A

Refers to the order in which instructions are executed in a computer program. It determines how the program progresses from one statement to another.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

FRQ #1

A

Refers to the first free-response question in the AP Computer Science A exam. It is a coding problem that requires students to write methods and implement control structures to solve a given problem.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

If-Else If-Else statements

A

Conditional statements that allow different blocks of code to be executed based on different conditions. They provide multiple branches for decision-making in a program.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

If-Else Statements

A

Conditional statements used in programming to make decisions based on certain conditions. They allow different blocks of code to be executed depending on whether a condition is true or false.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Indentations and Brackets

A

Used in programming to organize code and indicate the scope of blocks. Indentations help visually separate different sections of code, while brackets (such as curly braces {}) define the beginning and end of a block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

<= (less than or equal to)

A

This term refers to a comparison operator used in programming that checks if one value is less than or equal to another value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

> (greater than)

A

This term refers to a comparison operator used in programming that checks if one value is greater than another value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Q

> = (greater than or equal to)

A

This term refers to a comparison operator used in programming that checks if one value is greater than or equal to another value.

26
Q

Multiple-choice Questions

A

A type of assessment where students choose the correct answer from a set of options. Each question typically has one correct answer and several distractors.

27
Q

Nested Conditionals

A

Refer to having conditional statements (if/else) inside other conditional statements. This allows for more complex decision-making by evaluating multiple conditions within each other.

28
Q

Operators

A

Symbols or keywords used in programming languages to perform specific operations on one or more operands. They manipulate data and produce a result.

29
Q

Order of Operations

A

The order in which mathematical operations should be performed to obtain the correct result. It follows the acronym PEMDAS, which stands for Parentheses, Exponents, Multiplication and Division (from left to right), and Addition and Subtraction (from left to right).

30
Q

Referencing Objects with Aliases

A

Using multiple names to refer to the same object in computer programming. This allows us to access and modify an object through different variables.

31
Q

Relational operators

A

Symbols used in programming languages to compare two values and determine their relationship. These operators return boolean results indicating whether a condition is true or false.

32
Q

Return Statement

A

Used in functions/methods to specify what value should be sent back as output when the function is called. It terminates the execution of a function and returns control back to where it was called from.

33
Q

% (modulus) operator

A

Used in programming to find the remainder of a division operation. It returns the remainder after dividing one number by another.

34
Q

Block of Code

A

Refers to a group of statements that are grouped together and treated as a single unit. It is often used to organize and control the flow of execution in a program.

35
Q

Conditional Statement

A

A programming construct that allows the execution of certain code blocks based on whether a specific condition is true or false.

36
Q

Indentation

A

Refers to adding spaces or tabs at the beginning of lines of code to visually organize and structure it. In Python, indentation plays an important role in defining blocks of code within control structures like loops and conditionals.

37
Q

Method

A

A named sequence of instructions that can be called or invoked to perform a specific task or action. Methods are used for code reusability, organization, and abstraction.

38
Q

Brackets

A

Symbols used in programming to enclose and group together elements, such as variables or expressions, within a statement. They are typically represented by the characters “[” and “]”.

39
Q

if-else statement

A

A programming construct that allows the program to make decisions based on certain conditions. It checks a condition and executes one block of code if the condition is true, and another block of code if the condition is false.

40
Q

condition1

A

Refers to a logical expression that is evaluated to determine if a certain action should be taken. It is typically used in control structures like if statements and loops.

41
Q

condition2

A

Refers to another logical expression used in control structures. It helps determine whether an action should be executed based on specific criteria.

42
Q

condition3

A

Refers to yet another logical expression used in programming. It helps determine whether certain actions should be performed based on specific conditions being met.

43
Q

else if statement

A

Used when there are multiple conditions to be checked after an initial “if” condition, and each condition has its own block of code to execute.

44
Q

if statement

A

A programming construct that allows the execution of a block of code only if a certain condition is true.

45
Q

multi-way selection

A

Refers to situations where there are more than two possible outcomes or paths based on different conditions being evaluated.

46
Q

Compound Conditional Statements

A

A combination of multiple conditional statements joined together using logical operators such as “and” or “or”. It allows us to check multiple conditions at once.

47
Q

a && !a

A

This term refers to an expression that checks if one condition is true while the other is false using the logical AND operator.

48
Q

a && a

A

This term refers to the logical AND operator in programming, which checks if both conditions on either side of the operator are true.

49
Q

a || !a

A

The logical OR operator (||) can also be used in combination with the logical NOT operator (!). It checks whether at least one of the original value or its negation is true.

50
Q

a || a

A

The logical OR operator (||) can also be used to combine the same boolean value twice. If the value is true, the result will be true; otherwise, it will be false.

51
Q

a || false

A

This term refers to the logical OR operator in programming, which checks if at least one of the conditions on either side of the operator is true.

52
Q

a || true

A

The logical OR operator (||) is used to combine two boolean values. If either of the values is true, the result will be true.

53
Q

AND Operator

A

A logical operator that combines two or more conditions and returns true only if all conditions are true.

54
Q

Associative Law

A

States that the grouping of operations does not affect the result. In other words, it doesn’t matter how you group the operations, the outcome will be the same.

55
Q

DeMorgan’s Theorems

A

State two rules for simplifying logical expressions involving negations (NOT), conjunctions (AND), and disjunctions (OR). These rules allow us to switch between negating individual terms and negating the entire expression.

56
Q

Distributive Law

A

Allows us to distribute (or break apart) an expression into smaller parts and then combine them back together. It helps simplify calculations by breaking down complex expressions.

57
Q

!(!a)

A

Represents the double negation of a boolean variable a. It is equivalent to simply a.

58
Q

NOT operator

A

A logical operator that reverses the truth value of a given expression. It returns true if the expression is false, and false if the expression is true.

59
Q

OR Operator

A

A logical operator that combines two or more conditions and returns true if at least one condition is true.

60
Q

Theorems

A

Statements that have been proven to be true using logical reasoning and previously established facts.

61
Q

equals()

A

A method that is used to compare two objects for equality. It checks if the values of the objects are the same, rather than comparing their memory addresses.

62
Q

Primitive Types

A

Basic data types in programming that are built-in and cannot be broken down into smaller components. They represent simple values like numbers, characters, and boolean values.