1/12
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
• Loop
a structure that allows repetitive execution of a block of statements
• Loop Body
block of statements within a looping structure
• Types of C# Loops
while loop
for loop
do loop
do - while loop
• While Loop
executes a body of statements continuously as long as some condition to be true
• Ways you can Alter the Control Variable
incrementing
decrementing
• Definite lop or Counted loop
loop for which number of interactions is predetermined
• Indefinite Loop
Value of a loop control variable is not altered by arithmetic, but is instead altered by the user
• For loop
short hand way t create definite loops
a.k.a the pretest loop
• Sections of For loop
initializing, testing, and updating the control variable
• Do Loop
checks at the bottom of the loop after one reptation has occurred
convenient when you want to perform a task at least once
a.k.a the postest loop
• Nested Loop
contains an inner loop and an outer loop
loops cant over lap
• Sentinal Value
value of the same data type but not a legal data value
ex: double total =0;
• Improving Loop Performance
make sure the loop doesn’t include unnecessary operators or statements
ex: while (x < a+b) say int sum = a + b
while ( x < sum)