Computer Science I / Simple Modelling with Code
Practice question · Select all that apply

Select every practice that the lesson recommends when modelling a problem.

Hints
  1. One option is the named pitfall, not a recommendation.
  2. The lesson says diving straight into code leads to tangled, buggy code.
Show the answer
  • A. State the assumptions and constraints explicitly
  • B. Identify the data and its type before coding
  • C. Sketch the algorithm in pseudocode first
  • D. Decide what can vary and what must hold
Why

Naming the data, sketching pseudocode, stating constraints, and deciding what may vary are all recommended. Writing real code before modelling is the pitfall the lesson names, it almost always produces tangled, buggy code.

Read the lesson: Simple Modelling with Code →

Practise Simple Modelling with Code

The app has 6 more questions on this lesson, and keeps your place in the course. Computer Science I is free to start.

More questions on Simple Modelling with Code