Lesson 1 Flashcards

1
Q

algorithm

A

a set of ordered and finite steps to solve a given problem.

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

flowchart

A

graphical representation of an algorithm

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

decision tables

A

a more compact and readable format for presenting an algorithm

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

program

A

sets of precise and complete instructions to accomplish a task

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

syntax

A

vocabulary and grammar in a language

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

class

A

set of data and methods

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

variables

A

provide temporary storage during the execution of a program

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

constants

A

data fields or local variables whose value cannot be modified.

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

array

A

collection of items in which each item can be accessed by using a unique index.

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

operators

A

symbols that specify which operation to perform on the operands before returning a result.

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

methods

A

code blocks containing a series of statements. Methods can receive input via arguments and can return a value to the caller. If a method were to return a value, the appropriate data type for the return value would be used instead of “void.”

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

decision structures

A

introduce decision-making ability into a program. They enable you to branch to different sections of the code depending on the truth value of a Boolean expression.

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

C# decision-making control structures:

A

“if,” “if-else,” and “switch” statements.

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

if statement

A

will execute a given sequence of statements only if the corresponding Boolean expression evaluates to true.

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

if-else statement

A

allows your program to perform one action if the Boolean expression evaluates to true, and a different action if the Boolean expression evaluates to false.

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

switch statement

A

allows multi-way branching. They can often simplify a complex combination of if-else statements.

17
Q

C# control structures for repetitive tasks:

A

the while loop, the do-while loop, the for loop, and the foreach loop

18
Q

examples of control transfer statements which transfer control outside the loop:

A

break, goto, return, and throw

19
Q

statement to pass control to the next iteration of the loop without exiting the loop:

A

continue statement

20
Q

while loop

A

repeatedly executes a block of statements until a specified Boolean expression evaluates to false.

21
Q

general form of the while loop:

A

while (boolean test)

statement

22
Q

three main parts of a while loop:

A
  1. Initializer
  2. Loop test
  3. Termination expression
23
Q

do-while loop

A

repeatedly executes a block of statements until a specified Boolean expression evaluates to false. The do-while loop tests the condition at the bottom of the loop.

24
Q

general form of the do-while loop:

A

do
statement
while (boolean test);

25
Q

for loop

A

combines the three elements of iteration - initialization, termination condition expression, and the counting expression - into a more readable code.

26
Q

general form of the for loop:

A

for (init-expr; cond-expr; count)

statement

27
Q

foreach loop

A

useful for iterating through the elements of a collection

28
Q

parameter syntax for a foreach loop:

A

(ElementType element in collection)

29
Q

recursion

A

a programming technique that causes a method to call itself in order to compute a result

30
Q

distinct parts of a recursive algorithm:

A

base case and recursive case

31
Q

exception

A

an error condition that occurs during the execution of a program.

32
Q

How to handle exceptions…

A

Place the code that throws the exceptions inside a try block, and place the code that handles the exceptions inside a catch block.

33
Q

finally block

A

used in association with the try block. It is always executed regardless of whether an exception is thrown. The finally block is often used to write clean-up code.