Digital Tech and Innovations Writing Conditional Code Test Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

What is a block of code?

A

Code after an if statement in curly brackets

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

What are curly brackets?

A

What contains a block of code

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

what are parenthisis, brackets and curly brackets

A

()
[]
{}

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

What sign do you use to say something is equal

A

== two equal signs

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

What is “the if statement”

A

a desicion making statement

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

How do you write a if statement?

A

if(a > b)
{
}

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

Can you put an if statement in another if statement?

A

Yes

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

What is an else?

A

If it doesent follow the original if statement, direct it to this other block of code.

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

Can you have more then one else in an if statement?

A

No

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

How do if, else if, else statements work? ex

A

We start at the first statement, execute it then go to the next and next and so on. You start by asking the user a question. Then we input questions in the code (the if statement), if its this, do this, if its this, do this. We would right multiple if or if else statements that will provide all output options. The code runs through every option until it finds one that matches the input.

ex
if(a > b)
{ document.write(“result 1”) }
else if(a < b)
{ document.write(“result 2) }
else(a==b)
{ document.write(“result 3) }

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

How do you make more then one if statement?

A

If else

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

what is if else? ex

A

it asks a different question, for another outcome

ex

if(a==b)
{do this}
else if(a<b)
{do this}

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

what is a strict equality operator and what does it do?

A

its an operator that makes sure that the values and types of strings are the same. Ex 123 == “123”

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

what is a comparasin operator

A

compares its operands and returns a logical value based on whether the comparison is true. =< => etc

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

What are logical operators

A

Logial operators are operators where it checks for two true things at once

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