# 1.4 Scr0340: arithmetic operators in scratch 2.0  (Page 2/7)

 Page 2 / 7

## Operands

According to the current jargon, operators operate on operands .

For example, in the following expression, the plus character is an operator while x and y are operands.

x + y

Assuming that x and y are numeric variables, this expression produces the sum of the values stored in the variables named x and y . The variable x would be called the left operand and the variable y would be called the right operand .

## Expressions

Computer programs in many languages consist of statements, which in turn, consist of expressions. (Programming blocks substitute for statements in Scratch.)

An expression is a specific combination of operators and operands that evaluates to a particular result. The operands can bevariables, literals, or method calls. (Note that Scratch v1.4 didn't support methods. However, Scratch 2.0 allows you to design and create yourown blocks, which helps to alleviate that deficiency.)

In your past experience, you may have referred to expressions by the names formulas or equations . Although formulas and equations are not exactly the same thing as expressions, they are close enough to help youunderstand what expressions are and how they are used.

## Statements

A statement is a specific combination of expressions. The following is an example of a statement comprised of expressions in a text-based language such as Java, C++,or C#.

z = x + y;

Operationally, values are retrieved from the variables named x and y in the above statement. These two values are added together. The result is stored in (assigned to) the variable named z , replacing whatever value may previously have been contained in that variable.

The plus character (+) would commonly be called the addition operator or the concatenation operator, depending on the type of data stored in the variables named x and y . The equal character (=) would commonly be called the assignment operator in Java, Alice, C#, and C++, but wewill see in a future module that it is also used as a relational operator in Scratch.

## A brief word about type

As a very crude analogy, you can think of variables as the pens at the animal shelter and think of type as the kinds of animals that reside in those pens. Dogs and cats aredifferent types of animals that don't usually coexist very well in the same pen. Therefore, they are normally put in different pens.

Similarly, different types of data don't coexist well in the same variable in type-sensitive languages. Therefore, in type-sensitive languages, there are very stringent rules as to the types of data that can be stored in each variable.

Scratch has two types of data that can be stored in a variable (numeric and string) . However, Scratch is not a type-sensitive language so type is not an issue in Scratch. (Scratch also has a semblance of a boolean type but it tends to take care of itself.)

## Unary, binary, and ternary operators

Many programming languages provide operators that can be used to perform an action on one, two, or three operands. I believe that operators in Scratchare confined to only one or two operands.

how can chip be made from sand
is this allso about nanoscale material
Almas
are nano particles real
yeah
Joseph
Hello, if I study Physics teacher in bachelor, can I study Nanotechnology in master?
no can't
Lohitha
where is the latest information on a no technology how can I find it
William
currently
William
where we get a research paper on Nano chemistry....?
nanopartical of organic/inorganic / physical chemistry , pdf / thesis / review
Ali
what are the products of Nano chemistry?
There are lots of products of nano chemistry... Like nano coatings.....carbon fiber.. And lots of others..
learn
Even nanotechnology is pretty much all about chemistry... Its the chemistry on quantum or atomic level
learn
da
no nanotechnology is also a part of physics and maths it requires angle formulas and some pressure regarding concepts
Bhagvanji
hey
Giriraj
Preparation and Applications of Nanomaterial for Drug Delivery
revolt
da
Application of nanotechnology in medicine
has a lot of application modern world
Kamaluddeen
yes
narayan
what is variations in raman spectra for nanomaterials
ya I also want to know the raman spectra
Bhagvanji
I only see partial conversation and what's the question here!
what about nanotechnology for water purification
please someone correct me if I'm wrong but I think one can use nanoparticles, specially silver nanoparticles for water treatment.
Damian
yes that's correct
Professor
I think
Professor
Nasa has use it in the 60's, copper as water purification in the moon travel.
Alexandre
nanocopper obvius
Alexandre
what is the stm
is there industrial application of fullrenes. What is the method to prepare fullrene on large scale.?
Rafiq
industrial application...? mmm I think on the medical side as drug carrier, but you should go deeper on your research, I may be wrong
Damian
How we are making nano material?
what is a peer
What is meant by 'nano scale'?
What is STMs full form?
LITNING
scanning tunneling microscope
Sahil
how nano science is used for hydrophobicity
Santosh
Do u think that Graphene and Fullrene fiber can be used to make Air Plane body structure the lightest and strongest. Rafiq
Rafiq
what is differents between GO and RGO?
Mahi
what is simplest way to understand the applications of nano robots used to detect the cancer affected cell of human body.? How this robot is carried to required site of body cell.? what will be the carrier material and how can be detected that correct delivery of drug is done Rafiq
Rafiq
if virus is killing to make ARTIFICIAL DNA OF GRAPHENE FOR KILLED THE VIRUS .THIS IS OUR ASSUMPTION
Anam
analytical skills graphene is prepared to kill any type viruses .
Anam
Any one who tell me about Preparation and application of Nanomaterial for drug Delivery
Hafiz
what is Nano technology ?
write examples of Nano molecule?
Bob
The nanotechnology is as new science, to scale nanometric
brayan
nanotechnology is the study, desing, synthesis, manipulation and application of materials and functional systems through control of matter at nanoscale
Damian
how did you get the value of 2000N.What calculations are needed to arrive at it
Privacy Information Security Software Version 1.1a
Good
Got questions? Join the online conversation and get instant answers!