U3: Nested If Statements Flashcards

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

Program Control

A
  • How program executes code, makes decisions and organizes functions
  • How and which lines of code get executed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Sequential Program Control

A

Lines executed from first to last; top to bottom

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

Selection and Program Control

A

Computer makes choices on what to execute based on data.

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

Switch Statement Code

A

switch (variable) {
case “any”: case “ANY”:
codea;
break;
default:
codeb;
break;
}

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

Case Fall-Through

A

W/out break function, program executes each next case until reaching “break”

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

Switch Statements

A
  • Similar to if-then-else statement
  • Useful when decision based on single character, word or value
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Quotations with Cases

A

Use “” for characters; no quotations for numbers

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

Indenting and Braces

A

After every open brace, next line of code must be indented further

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

Nested if-then-else Statement

A

If-then-else statement programmed inside another if-then-else statement

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

White Space

A

Empty space/lines in the program

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

Coding Style

A

How code looks; Each person has a different coding style

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

Aspects of Coding Style [A]

A
  • How/when comments used
  • # of spaces for indentation
  • Use of white space
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Aspects of Coding Style [B]

A
  • Naming of variables and functions
  • Code organization
  • Patterns used and avoided
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Style Guides

A
  • Set of rules outlining how person’s programming works
  • Workplaces and languages can have rules/conventions
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Aspects of Style Guides [A]

A
  • Communication is key so everybody can agree
  • Makes old code easier to understand
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Aspects of Style Guides [B]

A
  • Makes errors obvious
  • Explaining details important for style guide