logo

AQA A-Level Computer Science practice

A program uses the same tax rate in several calculations. Which approach best applies the idea of a named constant?

Try the question first, then check the answer and practise the same topic again.

At a glance

MCQ

Type

practice

Style

Topic

Programming

Exam-style question

Try this first

A program uses the same tax rate in several calculations. Which approach best applies the idea of a named constant?.

  1. A.Store the rate under a meaningful constant name and use that name in the calculations
  2. B.Use a different literal rate in each calculation
  3. C.Store the rate in a variable and deliberately change it before every calculation
  4. D.Replace the rate with a comment

Answer and explanation

Concise answer

Store the rate under a meaningful constant name and use that name in the calculations

Why this is correct

A named constant gives the shared value a meaningful identity and helps keep the value consistent wherever it is used.

Use the concise answer above for a quick check, then reveal the full model answer and detailed explanation.

Common mistake

No common mistake is linked to this question yet.

Related flashcards

No flashcards are published for this page yet.

Related practice questions