Test 4 Flashcards

1
Q

“Or” truth table

A

T || T is T
T || F is T
F || T is T
F || F is F

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

“And” truth table

A

T && T is T
T && F is F
F && T is F
F && F is F

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

6 relational operators

A

== != > >= =

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

How do you use == with String?

A

variable1.equals(variable2);
Or
variable1.equalsIgnoreCase(variable2);

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

Decimal format money?

A
DecimalFormat money = new DecimalFormat("$0.00");
System.out.println(money.format(3.15));
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Logical operators?

A

&& || !

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

If statements format

A
If(test condition)
{
block of code;
}
else if(blah)
{
meow;
}
else
{
codes;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

a=3 vs a==3

A

a=3 is an assignment statement

a==3 is a Boolean test condition (used with if statements)

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

What is a Boolean statement

A

Fact that can be proven true or false

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