EZ Math Movie, Language, Printing



This command erases all printing on the printer. It is often used in the before loop code to insure that the printer is fresh and ready to go at the start of each program run. Here is an example of its use:


Tutorial: Printing a number


This command sends text to the printer. The text will appear on the current printer line, and the text will wrap if it exceeds the width of the printer. A new line will not be printed after the text, so the printer stays on the same line upon which it started. Here is an example of how to use this command:

print('Learn math by programing math.');

The above code would print the text 'Learn math by programing math' on the printer.

Tutorial: Printing text


This command sends the printer to the start of the next line. It is handy to move the printing to the next line after using the print and printNumber commands, since these commands do not create new lines after they output. Here is how to use printNewLine:

print('First line');
print('Second line');

The above code would produce the following output on the printer:

First line
Second line

Tutorial: Printing a new line


This command outputs a number on the printer that is rounded to the current number of decimal places. The current number of decimal places defaults to 2, but this can be changes with the setNumDecimals command. The printNumber command works this way:


The above code would produce the following output on the printer:


Tutorial: Printing a number

printStatement('prefix', n, 'suffix')

This command provides a shorthand way to print a common type of math statement. For example, the following code:

printStatement('The height is ', h, ' meters.');

Would place the following text on the printer, provided that the variable h held a value of 6:

The height is 6 meters.


The last parameter, 'suffix', can be skipped. So the following code:

printStatement('x = ', x);

Would produce the following printing, assuming that the variable x held a value of 7:

x = 7

Tutorial: Printing text and numbers


This command sets the maximum number of decimals for numeric value output. The last digit printed is rounded.  It works like this:


The above code would set all rounded numeric values to be printed to 3 decimal places. So this code:


Would print this:


All contents of EZ Math Movie are copyrighted: Copyright 2011, Edward A. Zobel. All rights reserved.

Other sites you may find interesting

Zona Land Education Like Math and Physics?

Zona Land Education offers explanations, diagrams, and animations on these topics.
And it is all presented in a clear and casual manner.

Here is the link: zonalandeducation.com

EZ Programing Demos Want to learn about programing computers?

EZ Programing Demos has an animated, slow motion, interactive programing language demonstrator.
The site presents basic ideas at a beginner's level.

Here is the link: ezprogramingdemos.com

Custom Search