Unot 4 AP comp sci

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

1/39

encourage image

There's no tags or description

Looks like no tags are added yet.

40 Terms

1
New cards

Variable

A named storage location for a value is a(n) _

2
New cards

userAge

A legal JavaScript variable name written in common camelCase style is _______

3
New cards

Variable assignment

The JavaScript statement 'var numApples = 20' demonstrates _______

4
New cards

readLine()

_ is a CodeHS-supported function used to read a line of text input

5
New cards

readInt()

To ask the user to enter a whole number—a program can use _______

6
New cards

Concatenation

Joining two or more strings together into one is called _

7
New cards

Florence Fernandez

If 'first_name' is 'Florence' and 'last_name' is 'Fernandez'—then 'first_name + last_name' produces _______ because no space was added between the strings

8
New cards

Output

Information that a program displays or produces is called _

9
New cards

30

The code 'var userNum = 5 var calculatedNum = (userNum * userNum) + userNum calculates _______

10
New cards

1

The result of 13 % 3 is _______

11
New cards

Leftover/remanider

The modulus operator ('%') returns the _______ after division

12
New cards

Speed = distance/time in hours

To calculate speed in kilometers per hour when time is given in minutes—convert minutes to hours and use _______

13
New cards

Variable assignment

In the AP CSP pseudocode—the left arrow represents _______

14
New cards

Modulus %

In AP CSP pseudocode—'MOD' performs the same type of operation as JavaScript's _______ operator

15
New cards

2

If a = 18—b = 4—and c = a MOD b—then the value of c is _______

16
New cards

1

For a = 10—b = 5—and c = 2—the expression ((a - b) * c) % 3 evaluates to _______

17
New cards

12.4

In 'var x = 4 * 3 + 2 / 5 ' multiplication and division happen before addition—so the result is _______

18
New cards

40

In CodeHS graphics—'new Circle(40)' creates a circle with a radius of _______

19
New cards

add(circle)

After creating and positioning a graphics object—use _______ to make it appear on the canvas

20
New cards

Color.blue

The method circle.setColor(Color.blue) sets the circle's color to _______

21
New cards

Top left

The canvas coordinate (0—0) is at the _______ corner of the graphics window

22
New cards

getWidth()/2 And getHeight()/2

The center of the canvas is located at _______

23
New cards

X coordinate

In 'ball.setPosition(x—y)'—the 'x' value represents the _______ of the circle's center

24
New cards

Y coordinate

In 'ball.setPosition(x—y)'—the 'y' value represents the _______ of the circle's center

25
New cards

Diameter/2

If the user enters a diameter—the radius used in 'new Circle(…)' should be _______

26
New cards

Circle radius

A circle positioned at (radius—radius) has its center at the coordinate whose x- and y-values both equal the _______

27
New cards

Added

If a program creates a circle and sets its position but does not call 'add(circle)'—the circle will not be visible because it has not been _______ to the canvas

28
New cards

Callback function

A function that is passed to an event handler and called when an event occurs is called a _______

29
New cards

mouseClickMethod(drawSquare)

To call 'drawSquare' whenever the mouse is clicked—write _______

30
New cards

event handler

When using 'mouseClickMethod(drawCircle)'—the function name is passed without parentheses so it can be called when the event happens by the _______

31
New cards

X coordinate

In 'function drawCircle(e)'—the parameter 'e' contains information about the mouse event—including the click location. The expression 'e.getX()' gives the mouse click's _______

32
New cards

Y coordinate

The expression 'e.getY()' gives the mouse click's _______

33
New cards

Click

A program that creates a circle at 'e.getX()—e.getY()' places the circle where the user _______

34
New cards

Mouse Event

An event triggered specifically by mouse activity is a(n) _

35
New cards

High level

Of binary—assembly language—and JavaScript—JavaScript is considered a _______ language

36
New cards

Binary

The number sequence '10110011010011101010' is written in _______

37
New cards

Smartphone

A _______ is a device that can perform computational tasks

38
New cards

Hello Rowan

In the example where the user enters 'Rowan'—the displayed greeting is _______

39
New cards

3

In the assignment sequence a = 12

40
New cards

Sequence

The AP CSP idea of executing instructions in order is called ______