Pular para o conteúdo

Lesson 42: Collect the points

English

Stop at the marker

  • Sometimes you do not know how many values there are. The data ends with a special value that only means "stop": a rogue value.
  • A condition-controlled loop (while) runs until it meets the rogue value.
  • Inside the loop, totalling adds each value and counting adds 1 each time.

Words for this lesson

Word Meaning
rogue value a value that marks the end of the data
totalling adding each value to a running total
counting adding 1 each time something happens

Entrar ou criar conta

IGCSE, A-Level & AP