返回卡包市场

U3: Nested If Statements

暂无描述。系统推荐的高质量记忆内容,适合每天坚持背诵学习。

卡片总数: 16内容版本: v4公开卡包更新时间: 8/1/2026

卡片预览 (16 张)

#1
正面 (问题)

Program Control

背面 (解答)

• How program executes code, makes decisions and organizes functions • How and which lines of code get executed

#2
正面 (问题)

Sequential Program Control

背面 (解答)

Lines executed from first to last; top to bottom

#3
正面 (问题)

Selection and Program Control

背面 (解答)

Computer makes choices on what to execute based on data.

#4
正面 (问题)

Switch Statement Code

背面 (解答)

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

#5
正面 (问题)

Case Fall-Through

背面 (解答)

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

#6
正面 (问题)

Switch Statements

背面 (解答)

• Similar to if-then-else statement • Useful when decision based on single character, word or value

#7
正面 (问题)

Quotations with Cases

背面 (解答)

Use “” for characters; no quotations for numbers

#8
正面 (问题)

Indenting and Braces

背面 (解答)

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

#9
正面 (问题)

Nested if-then-else Statement

背面 (解答)

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

#10
正面 (问题)

White Space

背面 (解答)

Empty space/lines in the program

#11
正面 (问题)

Coding Style

背面 (解答)

How code looks; Each person has a different coding style

#12
正面 (问题)

Aspects of Coding Style [A]

背面 (解答)

• How/when comments used • # of spaces for indentation • Use of white space

#13
正面 (问题)

Aspects of Coding Style [B]

背面 (解答)

• Naming of variables and functions • Code organization • Patterns used and avoided

#14
正面 (问题)

Style Guides

背面 (解答)

• Set of rules outlining how person’s programming works • Workplaces and languages can have rules/conventions

#15
正面 (问题)

Aspects of Style Guides [A]

背面 (解答)

• Communication is key so everybody can agree • Makes old code easier to understand

#16
正面 (问题)

Aspects of Style Guides [B]

背面 (解答)

• Makes errors obvious • Explaining details important for style guide