Unable to open this exercise
Common exam pitfall
Students often use the assignment arrow (<-) or colon when declaring constants instead of the equals sign (=).
A variable stores a value that may change. A constant names a value that does not change while the program runs. Naming a fixed price or limit makes its purpose clear and avoids repeating unexplained numbers.
CONSTANT TicketPrice = 7
DECLARE Tickets : INTEGER
INPUT Tickets
OUTPUT TicketPrice * Tickets
Worked example
For three tickets, the expression is 7 × 3 = 21. The number of tickets is input and may differ next time; TicketPrice stays fixed in this program. Changing the price in one declaration is easier to maintain than finding many occurrences of 7.
Do not write INPUT TicketPrice: input belongs in a variable. Scope—where an identifier can be used—is taught with procedures and functions, after you have seen those constructs.
AI Socratic Tutor
Need guidance? Ask a question or use the hint below.
AI Socratic Tutor is an All-Access Benefit
Unlock step-by-step Socratic hints, algorithm trace table walkthroughs, and error diagnostics for every Cambridge exercise.
You're chatting with an AI tutor, not a person. AI can make mistakes, so double-check its answers.
Exam-Style Check: Constant Declaration Syntax & Mutability
• Multiple ChoiceWhich statement correctly declares a named constant for maximum capacity with the value 500 in Cambridge pseudocode?
Interactive exercises for Module 2 and beyond require an active plan.