A control structure that allows a statement or a group of statements to be executed several times
2
New cards
Initialization
conditions
body
change of state
What are the 4 components of a loop?
3
New cards
Accumulator
It is sum of the variables of the counter
4
New cards
For loop
It is a loop used to repeat a specific block of code a KNOWN number of times
5
New cards
while loop
It is a loop used to repeat a specific block of code an UNKNOWN number of times
6
New cards
do-while loop
A loops used when a block of code is needed o be executed at least once
7
New cards
False
True or false
\ In **for (initialization; condition; dec)** loop statement; the final value for the loop control variable should be greater than the initial value in order to execute the statements inside the for loop
8
New cards
True
True or False
\ In **for (Initialization; condition; inc)** loop statement; the initial value of the loop control varable should be less than the final value in order to execute the statements inside the for loop
9
New cards
Array
It is a collection of variable of the same type that are referenced by a common name.
10
New cards
Extraction
It is a function that accepts an array *a* and element of its index type *i* and returns an element of the array’s base type
\ ex: cout << a\[i\];
11
New cards
Storing
It accepts an array *a*, an element of its index type *i,* and an element of its base type x
\ ex: a\[1\]=4
12
New cards
300
How many elements can int name \[30\]\[10\] store?
13
New cards
rows
in int name \[30\]\[10\], what does 30 determine?
14
New cards
columns
in int name \[30\]\[10\], what does 10 determine?
15
New cards
True
True or false
\ The index for a 2D array should always be an int
16
New cards
False
True or false
\ It is possible to run a 2D array using variables instead of int constants
\ ex: int name \[a\]\[b\];
17
New cards
Functions
These are the building blocks in C language. It is a subroutine that containts one or more C statements that performs one or more tasks
18
New cards
Function definition
it is a set of instructions for perfoming a task
19
New cards
Local variable
* A variable defined within a function * It cannot be recognized by other functions
20
New cards
Global variable
a variable declared outside of all functions and can be used in any part of the program
21
New cards
Formal Parameter
They are variables that are declared to ACCEPT the actual parameter values
22
New cards
Actual Parameter
They are values that are given or passed to the formal parameter
23
New cards
Function Header
What is A called?
24
New cards
Function Body
What is B called?
25
New cards
Function definition
What is C called?
26
New cards
Length()
A string function that counts how many characters are in a string
27
New cards
find()
a string function that finds a specific character or group of characters in a string
28
New cards
substr()
a string function that is used for extraction
29
New cards
insert()
a string function that inserts a word or character within a string
30
New cards
assign()
a string function that assigns a value to a string
31
New cards
concatenation/append
a string function that joins two or more strings together