Unit 1: CS21 Review Flashcards

1
Q

what are string literals

A

a sequence of characters enclosed in double quotes which is assigned to a variable

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

data type

A

Determines what kind of data a variable can hold

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

examples of primitive data types

A

int, double, boolean, and *char
*not mentioned on the AP test

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

double is more bits than int

A

true

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

athematic expressions

A

expressions with int or double formed by +,-,*,/, and %

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

int + int

A

int

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

int + double

A

double

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

when doing mod does the big or small number go first?

A

big

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

compound expressions

A

expressions with multiple arithmetic operators

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

what is order precedence

A

PEMDAS

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

what is the assignment operator

A

=

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

what are the increment operators?

A

++,—

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

what happens when a variable is declared as final?

A

the value can’t be changed once it’s initialized, any attempt results in an compilation error

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

compound assignment operators

A

+=,-=,*=,=, %=

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

casting

A

process of converting a variable from one data type to another

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

rounding

A

modifies a double vale to the nearest integer value

17
Q

if you cast a double to an int what hapoens

A

anything after the decimal point in the double is cut off (without rounding)

18
Q

double rounded if positive

A

(int)(x+0.5)

19
Q

double rounded if negative

A

(int)(x-0.5)

20
Q

overflow

A

if a num surpasses the java max then it goes back the the same number. uh negative

21
Q

compiler

A

Software that translates to Java source into the job class while what can be run on the computer

22
Q

Compiler or syntax error

A

lAn those foundering the completion

23
Q

main method

A

where execution starts jv a java program

24
Q

compiler or syntax error

A

error during compile

25
Q

variable

A

name associated with a memory location in a computer

26
Q

declare a variable

A

spesficy the type and name

27
Q

data type

A

Determines the size of memory reserve for a variable

28
Q

camel case

A

One way to create a variable name by a pending several words together in uppercase the first letter of each word after the first (myScore)

29
Q

operator

A

Common mathematical symbols

30
Q

what happens if you attempt to divide an integer by zero?

A

The arithmetic exception error occurs

31
Q

the

A