CompSci Exam Review (Looping)

0.0(0)
studied byStudied by 2 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/12

flashcard set

Earn XP

Description and Tags

GoodLuck!

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

13 Terms

1
New cards

• Loop

  • a structure that allows repetitive execution of a block of statements

2
New cards

• Loop Body

  • block of statements within a looping structure

3
New cards

• Types of C# Loops

  • while loop

  • for loop

  • do loop

  • do - while loop

4
New cards

• While Loop

  • executes a body of statements continuously as long as some condition to be true

5
New cards

• Ways you can Alter the Control Variable

  • incrementing

  • decrementing

6
New cards

• Definite lop or Counted loop

  • loop for which number of interactions is predetermined

7
New cards

• Indefinite Loop

  • Value of a loop control variable is not altered by arithmetic, but is instead altered by the user

8
New cards

• For loop

  • short hand way t create definite loops

  • a.k.a the pretest loop

9
New cards

• Sections of For loop

  • initializing, testing, and updating the control variable

10
New cards

• 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

11
New cards

• Nested Loop

  • contains an inner loop and an outer loop

  • loops cant over lap

12
New cards

• Sentinal Value

  • value of the same data type but not a legal data value

  • ex: double total =0;

13
New cards

• 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)