Operators and Expressions

Venue
A-to-Z Handbook on Teaching Programming
Paper Type
Book Chapter
Date
June 2020

Most programs involve the manipulation of data. Numbers may be added, text concatenated, truth values combined, or two values simply compared with each other. The pieces of source code that perform these data manipulations are called expressions. Expressions may be used to compute the value to assign to a variable, to compute the truth value of the condition (true or false) that controls a loop or a conditional statement, or to compute the arguments needed to call a function, procedure, or method. As such, they are key programming concepts and must be highlighted as such in instruction.

Expressions consist of operators and operands. Operands denote the values, and operators denote the computation to perform on those values. ...