APCSP Unit 3 Vocab

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
full-widthPodcast
1
Card Sorting

1/85

encourage image

There's no tags or description

Looks like no tags are added yet.

86 Terms

1
New cards

Compiler

A special program that takes care of converting programs into binary machine code

2
New cards

Variable

Something that stores information in program so that it can be used later; An abstraction inside a program that can hold a value; each one of these 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; using meaningful names for these helps with the readability of program code and understanding of what values are being represented

3
New cards

Algorithm

A self-contained step-by-step set of instructions to solve a problem (accomplish a task); can be expressed in a variety of ways, such as natural language, diagrams, or psuedocode; can be constructed using combinations of sequencing, selection, and iteration


4
New cards

String

An ordered sequence of characters

5
New cards

Concatenation

Joins together two or more strings end

6
New cards

Input Function

A function that prints a prompt and retrieves text from the user.

7
New cards

Mouse Events

When a user does something with a mouse like clicking or moving

8
New cards

Callback Function

A function that gets called by a program in response to some event

9
New cards

When should you use an integer?

When the value represents a whole number or something being counted, such as the number of students, number of tickets, or number of complete groups.

10
New cards

When should you use a float?

When the value can contain a decimal, such as a temperature, measurement, average, or price.

11
New cards

When should you use a string?

When the value represents text, such as a name, username, or message.

12
New cards

How do you choose the best data type for a variable?

Think about what kind of information the variable needs to store: a whole number, a decimal number, or text.

13
New cards

What makes a variable name appropriate?

It should clearly and specifically describe the value being stored.

14
New cards

Why are overly general variable names sometimes a problem?

They may not tell the reader exactly what information the variable represents.

15
New cards

When choosing between several reasonable variable names on an exam, what should you look for?

Choose the name that most precisely describes the specific value being stored.

16
New cards

What counts as user input?

Information the user directly enters or selects while using the program.

17
New cards

How can you tell whether something is user input?

Ask: "Would the person using the program need to enter or select this information?"

18
New cards

What data type does input() return?

A string.

19
New cards

If a user types 15 into input(), is the value automatically an integer?

No. It is initially the string "15".

20
New cards

What does int(input()) do?

It gets input from the user and converts that input into an integer.

21
New cards

What happens in age = int(input("Enter age: "))?

The program gets the user's input, converts it to an integer, and stores the integer in age.

22
New cards

Why would you convert user input to an integer?

So the program can use the value as a whole number in calculations.

23
New cards

What does float(input()) do?

It gets input from the user and converts it into a float so decimal values can be used in calculations.

24
New cards

Can int() convert the string "15" into an integer?

Yes. It becomes the integer 15.

25
New cards

Can int() directly convert the string "hello" into an integer?

No. "hello" does not represent a number that can be converted to an integer.

26
New cards

What happens when a value is assigned to a variable?

The value is stored in that variable.

27
New cards

What happens when a variable is reassigned?

Its old value is replaced by the new value.

28
New cards

If x = 5 and then x = 9, what is the final value of x?

9.

29
New cards

If x = 5 and then x = x + 2, what is the new value of x?

7.

30
New cards

How does x = x + 2 work?

The program uses the current value of x, adds 2, and then stores the new result back in x.

31
New cards

When evaluating an assignment statement, which side is calculated first?

The right side. The result is then stored in the variable on the left.

32
New cards

When tracing code, should you continue using a variable's original value after it has been reassigned?

No. Always use its most recently assigned value.

33
New cards

Trace: a = 4, b = 7, a = b. What are the final values of a and b?

a = 7 and b = 7.

34
New cards

Trace: x = 3, y = 8, x = y, y = x + 2. What are the final values of x and y?

x = 8 and y = 10

35
New cards

Trace: a = 10, b = 4, a = a + b, b = a

  1. What are the final values of a and b?
36
New cards

What is the safest way to trace several variables?

Go one line at a time and update each variable's value immediately when an assignment/reassignment occurs.

37
New cards

Operator Precedence

Tells us what mathematical operation to do FIRST in the following order: Parentheses ( ), Exponents **, Modulo/Multiplication/Division (equal priority, left to right), Addition/Subtraction (equal priority, left to right)

38
New cards

What does + do?

Addition.

39
New cards

What does

do?

40
New cards

What does * do?

Multiplication.

41
New cards

What does / do?

Regular division

42
New cards

What does // do?

Floor division

43
New cards

What does % do?

It returns the remainder after division.

44
New cards

What does ** do?

Exponentiation.

45
New cards

What is 2 ** 5?

32.

46
New cards

What is 17 / 4?

4.25.

47
New cards

What is 17 // 4?

4.

48
New cards

What is 17 % 4?

1.

49
New cards

If 93 students are placed into groups of 40, what does 93 // 40 equal?

2, because two complete groups of 40 fit into 93.

50
New cards

If 93 students are placed into groups of 40, what does 93 % 40 equal?

13, because 13 students remain after making two complete groups of 40.

51
New cards

If 135 tickets are exchanged in groups of 50, what does 135 // 50 equal?

2 complete groups.

52
New cards

If 135 tickets are exchanged in groups of 50, what does 135 % 50 equal?

35 tickets remaining.

53
New cards

If n % 3 = 0, what does that tell you?

n is evenly divisible by 3.

54
New cards

If a number is evenly divisible by another number, what is the remainder?

0.

55
New cards

Which happens first: multiplication/division or addition/subtraction?

Multiplication and division happen before addition and subtraction unless parentheses change the order.

56
New cards

What happens when two operations have the same precedence?

Evaluate them from left to right.

57
New cards

Evaluate 4 + 3 * 2.

  1. Multiply first: 3 * 2 = 6, then 4 + 6 = 10.
58
New cards

Evaluate (4 + 3) * 2.

  1. Parentheses first: 4 + 3 = 7, then 7 * 2 = 14.
59
New cards

Evaluate 12

6 / 3.

60
New cards

Evaluate 6 * (10

3 * 2).

61
New cards

Evaluate 20 // 6.

3.

62
New cards

Evaluate 20 % 6.

2.

63
New cards

Evaluate 14 % 5 + 2.

  1. 14 % 5 = 4, then 4 + 2 = 6.
64
New cards

Evaluate (19 % 5) + 1.

  1. 19 % 5 = 4, then 4 + 1 = 5.
65
New cards

What is the best way to avoid mistakes on a long mathematical expression?

Work through one operation at a time using the order of operations instead of trying to calculate the entire expression mentally.

66
New cards

Why are parentheses important when substituting expressions?

They preserve the grouping and order of operations from the original code.

67
New cards

Suppose a = 12

4, b = 18 / 3, and c = a + 2 * b. What single expression represents c?

68
New cards

When comparing several expressions to a multi

line program, what should you calculate first?

69
New cards

If one supplied procedure appears inside another (nested), which should you evaluate first?

The inner procedure.

70
New cards

If a supplied procedure has multiple arguments, does their order matter?

Yes. Match each argument to its position in the procedure definition.

71
New cards

When creating a circle on a coordinate graph, what do the x and y values represent?

The center point of the circle.

72
New cards

If a circle has x = 3 and y = 5, where is its center?

(3, 5).

73
New cards

What does the radius of a circle measure?

The distance from the center of the circle to its edge.

74
New cards

Is the radius the distance all the way across the circle?

No. The distance all the way across is the diameter.

75
New cards

How are radius and diameter related?

The diameter is twice the radius.

76
New cards

A circle is centered at (4, 6) with a radius of 2. What does that tell you?

The center is at (4, 6), and the edge of the circle is 2 units away from the center.

77
New cards

In the point (3, 7), what is x and what is y?

x = 3 and y = 7.

78
New cards

If xVal = 4, what is xVal + 2?

6.

79
New cards

If xVal = 4 and yVal = 5, what point is (xVal, yVal + 2)?

(4, 7).

80
New cards

If xVal = 4 and yVal = 5, what point is (xVal + 2, yVal)?

(6, 5).

81
New cards

If xVal = 4 and yVal = 5, what point is (xVal + 2, yVal

3)?

82
New cards

How should you solve a graph question containing variables inside coordinates?

Substitute the variable values and calculate the actual coordinates before comparing them with the graph.

83
New cards

What should you do when an FRQ says IDENTIFY?

State the requested information directly and accurately.

84
New cards

What should you do when an FRQ says DESCRIBE?

Give details about what something is or what it does, including how the relevant expression determines its value.

85
New cards

What should you do when an FRQ says EXPLAIN?

Connect cause and effect. Show how or why one part of the program leads to the requested result.

86
New cards

What's the difference between DESCRIBE and EXPLAIN on these FRQs?

Describe tells what the expression does and how it determines the value. Explain connects that value to what happens in the program or what is displayed.