Day 4 Flashcards

1
Q

What are the compound statements?

A

! – NOT – inverts the truth
&& - AND – both must be true
Double bar – OR – at least one must be true

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

Four essential actions of LOOPS

A
  1. Initialization – assigns initial value of control variable
  2. Condition – evaluates the control to determine whether the loop will execute.
  3. Change- changes the value of the control to ensure loops has a means of exiting.
  4. Body- statements defined between the opening and closing curly braces of loop.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

While loops

A

If condition fails the first time, loop never executes.

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

For loop

A

Counting loop; updated until condition specified is no longer true.

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

FOR EACH loop

A
Pushes value into identifier. Used to iterate through a set of items
	I.e – {
 	For (int x : 1, 2, 3, 4, 5} 
	 //note that the colon is why it is a for each and value is pushed into x
	{	
		Cout << x << “!”;}
	Return 0;   ANSWER IS  1!2!3!4!5!
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Explain: Jump Statements

A
  1. Break: a way to immediately exit from a loop statement and continue executing the program with the next statement following the loop body.
  2. Continue: terminates the current iteration of loop and control jumps to the beginning of the loop for the next iteration
  3. Return: terminates execution of a function and returns control to the calling function
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Which is the most popular debugging tool?

A

GNU debugger

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