Programming Fundamentals: Logic, Flow Control, Errors, and Loops

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/46

flashcard set

Earn XP

Description and Tags

A complete set of vocabulary flashcards covering logical expressions, flow control, debugging concepts, errors, and loop structures.

47 Terms

1
New cards

Logical Expression

Compares values and produces a boolean true or false result.

2
New cards

Relational Operator

The comparison symbols (

3
New cards

Flow Control

Refers to the order in which your program executes statements.

4
New cards

If()

Allows you to run a certain block of code if a logical expression evaluates to true.

5
New cards

Body

A block of code marked by opening and closing curly braces.

6
New cards

Else If()

Evaluates other logical expressions when prior if() statements are false.

7
New cards

Else

Keyword that marks a block of code that will run when all earlier if() and else if() expressions are false.

8
New cards

Nested

Code that is entirely contained inside an outer block of code. Both inner and outer blocks may use any mixture of flow-control logic.

9
New cards

Switch()

Allows you to test one variable or expression for many possible matching values.

10
New cards

Case

Represents one possible value of the expression in a switch statement.

11
New cards

Break

Keyword that causes program execution to immediately exit the current loop.

12
New cards

Default

Keyword that marks a block of code in a switch statement that will execute if none of the other cases match the test expression.

13
New cards

Compound Expression

An expression that includes both logical and relational operators.

14
New cards

And

The 'and' operator (&&) returns true if the left and right values are both true.

15
New cards

Or

The 'or' operator (||) returns true if the left or right value is true.

16
New cards

Exclusive Or

The 'exclusive or' operator (^) returns true if the right value is false and the left value is true or vice versa.

17
New cards

Not

The 'not' operator (!) returns true if the right value is false or false if the right value is true.

18
New cards

Operator Precedence

The term which describes the priority order in which operations are carried out within a single expression.

19
New cards

Short Circuiting

Skipping the evaluation of part of a logical expression if that part cannot possibly change the overall result.

20
New cards

Commutative Law

States that any finite sum or product is unaltered by reordering its terms or factors.

21
New cards

Associative Law

States that terms or factors may be grouped in any way without changing the result.

22
New cards

Distributive Law

States that multiplying a number by a group of numbers added together is the same as doing each multiplication separately.

23
New cards

Identity Law

States that if you AND or OR a Boolean value with itself, you will get the original value.

24
New cards

Truth Table

Demonstrates the result of a logical expression for all possible combinations of inputs.

25
New cards

Syntax Error

Happens when the compiler finds one or more invalid lines of code that don't follow the rules of the programming language.

26
New cards

Lexical Error

Happens when you try to use a keyword that is not recognized by the language.

27
New cards

Runtime Error

Behavioral (logical) problems or exceptions that appear when you run a program.

28
New cards

Bug

An error or problem with the execution of a program.

29
New cards

Debugging

The process of finding and fixing errors in your program code.

30
New cards

Code Review

A method to find runtime errors by reading through your code to see if you can spot the problem.

31
New cards

Tracing

A technique for finding runtime errors that use very verbose program output to help you follow your program flow while it is running.

32
New cards

Boundary Conditions

Represent the unusual (but valid) data values you should consider when designing and testing your program.

33
New cards

IDE

Integrated Development Environment is a single software package that allows programmers to design, write, run, and test programs in one application.

34
New cards

Running

When a program is executing at full speed and debugging commands are not available.

35
New cards

In Break

When a program is paused at runtime and the debugger allows you to inspect variables or issue debugging commands.

36
New cards

Breakpoint

A place in the code where you want the debugger to stop and put the program in a break state.

37
New cards

Visual Studio IDE

An IDE created by Microsoft and often used to create C# programs.

38
New cards

Iteration

The act of repeating a block of code multiple times.

39
New cards

Loop

A piece of code that executes the same block of statements more than one time.

40
New cards

For()

A loop that is generally used to execute a set of statements repeatedly when you know the number of loop iterations in advance.

41
New cards

Initialization Statement

A statement that identifies a loop index variable and sets it to some initial value.

42
New cards

Test Expression

A logical expression that compares the value of the loop index variable to some end target or terminal value.

43
New cards

Assignment Statement

A C# statement that uses the equals sign (=) to store a value in a variable.

44
New cards

While()

Used to execute a set of statements while a logical expression is true.

45
New cards

Infinite Loop

Occurs when the program flow is stuck inside a loop and can never reach the exit conditions for that loop.

46
New cards

Do While()

Loop used to execute a set of statements while a condition is true, with the condition tested at the end of the loop.

47
New cards

Continue

A statement that immediately skips the remainder of the statements in a loop body and starts the next loop iteration.