EZ Programing Demos

Slow motion, step by step, animated demonstrations of basic computer programing techniques

Links to topics:

Current topic:

Add, subtract, multiply, divide

Most computer languages perform mathematics. The symbols used for the arithmetic operations often appear this way:

    The addition sign: +

    The subtraction sign: -

    The multiplication sign: *

    The division sign: /

Below is a demo that prints the results of some simple mathematics. You can use it to familiarize yourself with these symbols for arithmetic operations.

 Slow  Medium  Fast 
Click 'Run' to go.

Using an astrick for a multiplication symbol may be new to you, but that is usually how it is done. Also, in computer languages multiplication must always be stated with the multiplication symbol. Multiplication can not be implied, as it is in many mathematics notation situations. For example, often in math subjects the number 2 times the variable a can look this way:

    2a

But in computer language notation, it almost always looks this way:

    2*a

 

It is usually okay to place a math expression anywhere it would be okay to place a single number. For example, if we consider printing the number 5, then our demo might contain a statement like:

    print 5

Where the 5 appears we could imagine placing an entire math expression containing numbers, variables, and function calls, such as:

    print 5 + x + rnd()

And if the following statement plotted a point on a graph at (4, 6):

    point 4, 6

Then it would be okay to place larger expressions for the coordinates, as in:

    point x + 4, y + 6

 

Here is the flowchart for this demo:

 

This demo written in an imaginary computer language could look like this:

    
    printLine(2 + 3);
    

 

Suggested next article:

At EZ Math Movie

EZ Math Movie is a site that can help you experiment with and understand many topics in mathematics. Its main feature is an interactive animated (x, y) graph that you control with an actual programing language. There are many examples and tutorials, and EZ Math Movie is crossed referenced with both EZ Programing Demos and Zona Land Education.

 

Zona Land Education is a site with explanations and interactive diagrams covering many topics in physics and mathematics. Zona Land Education is cross referenced with EZ Math Movie, and it contains several animations that use EZ Math Movie's programing language.