Back to Topic 6.3 — Programming constructs
6.3.1Computer Science SL5 flashcards

Sequence

Practice Flashcards

Flip to reveal answers
Card 1 of 56.3.1
6.3.1
Question

Why are sequence errors hard to spot?

Click to reveal answer

Track your progress — Sign up free to save your progress and get smart review reminders based on spaced repetition.

All 5 Flashcards — Sequence

Sign up free to track progress and get spaced-repetition review schedules.

Card 1concept

Question

Why are sequence errors hard to spot?

Answer

Both lines are perfectly valid, so nothing is reported. The program runs to completion and simply produces the wrong answer.

Card 2concept

Question

What causes an infinite loop?

Answer

The thing the loop's test depends on never changes — most often because the counter is increased inside a branch that does not always run, so the test can never become false.

Card 3process

Question

Where do setup, work and reporting belong relative to a loop?

Answer

Set up before the loop — totals at 0, counters at their start. Do the work for one item inside. Print or return the finished result after, since printing inside shows a running value rather than the final one.

Card 4definition

Question

What is deadlock and how is it prevented?

Answer

Two parts of a program each hold a resource the other is waiting for, so neither can move. It is prevented by having every part claim shared resources in the same fixed order.

Card 5process

Question

What three questions check that a sequence is right?

Answer

Is every value set before it is used? Does the thing the loop tests always change? Is the result used after it is complete rather than during? Those three catch nearly every sequence error.

Track your progress with spaced repetition

Sign up free — Aimnova tells you exactly which cards to review and when, so you remember everything before your IB exam.

Start Free