seegongsik
Saved words
Programming

Calculating with symbols

Plus, minus, greater than, equal. Symbols that do something with values are called operators. Some make a new value, some compare two and give true or false. The "true·false" of last time's condition comes from right here.

01

Add, subtract, multiply

The most familiar operators
are calculation.
Plus, minus,
times, divide.
Put in two values
and out comes one new value.
Below, change the symbol
and see how the result changes.

=11
7 plus 4 is 11. Change the symbol and the result changes.

Two values, one symbol, one new value. (7 + 4 = 11 · change the symbol, the result changes)

Two numbers
and one symbol is all it takes.
By the symbol
it adds or subtracts.
Making a new value
out of values like this
is an arithmetic operator.
Just like a calculator.

02

Greater, less, equal

Another kind of operator
compares.
"Greater, less, equal."
Compare two values
and out comes not a number
but true or false.
"7 is greater than 4" is true,
"7 equals 4" is false.

7 > 4true
A comparison operator gives true or false. It is the very true·false that the "if" used last time.

Compare two values, and true or false. (7 > 4 → true · comparison gives true·false)

A calculation operator
makes a new value,
a comparison operator
gives true or false.
Remember?
Last time "if"
picked a path
with this true·false.

03

What does this symbol do?

Let's meet the operator symbols
one by one.
What each one does,
laid out in a line.
The adding, the subtracting,
the comparing.
Tap one
and its meaning appears.

Plus
Adds two values into a new value · calculation
Yellow symbols calculate (new value), blue symbols compare (true·false).

Tap a symbol to see its meaning. (Yellow = calculation·new value · blue = comparison·true·false)

There aren't many symbols.
But with these few
you add
and make judgments too.
Each is simple on its own,
but gathered, nothing is beyond them.
Operators are such small tools.

04

True·false becomes a fork

Why does a comparison operator matter?
Because the true·false it gives
is the fork's switch
from last time's "if."
Compare "is the score 60 or higher,"
and true takes the pass path,
false the fail path.

compare
75 ≥ 60
true·false
true
if (fork)
pass
Score
The true·false a comparison operator gives moves the "if" fork from last time.

Compare → true·false → if (fork). (75 ≥ 60 → true → pass)

This is how lesson 6 and 5
connect.
An operator makes the true·false,
and "if" takes it
to pick a path.
One small symbol
grows into a program's judgment.

05

A hand to make and compare values

An operator
is a hand for handling values.
Add to make a new value,
compare to give true·false.
With this hand
a program calculates and judges.
Next we'll see how to make it
do the same thing many times.

Operator = a symbol to make and compare values
Calculation makes new values · comparison makes true·false. True·false leads to "if."
Loops
The same thing many times
Functions
Bundle it and name it
Beyond
Bigger programs
Next time we will touch "loops," repeating the same thing many times.

Once you know the symbols, now. (Operator = a symbol to make and compare values → loops · functions · beyond)

Now we've named values (variables),
known their kinds (data types),
judged by comparing (conditions),
and reached calculating (operators).
With these tools stacked one by one
we'll build bigger and bigger things.

In one lineAn operator is a symbol for handling values. A calculation operator makes a new value; a comparison operator gives true and false. That true·false connects to last time's "if" fork. Small symbols gather into a program's calculation and judgment.
Was this helpful? Support seegongsik
Programming