EZ Programing Demos

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

Links to topics:

Current topic:

Printing words

Here we look at a command called printLine. It will print the words that follow the command's label.

Click the Run button, and the program will print the quoted text. The printing will appear in the white printer area.

If you want to, you can change the words in the text box. Run the program after your changes, and you should see your new message printed.

There's more information below.

 Slow  Medium  Fast 
Click 'Run' to go.

Quotes are used for printing text.

At EZ Programing Demos when words are shown to be printed, the words are placed within quotes. In the context of computer languages the group of words, or any text in general, placed between quotes is refered to as a string. It's called a string because it is a sting of characters. So, here would be a string:

    "Have a good day."

Although it sounds a bit strange at first, because of the quotes you would call the following a string and not a number:

    "123"

In another article you will notice that quotes are not used when printing variable values. Variable values are not words, as it turns out. That article is named 'Printing the value of a variable'. It shows how variable values are printed without quotes.

The word 'line' in the command printLine means that a new line for printing is created as a final step when this command is executed. The next article titled 'Printing words on several lines' clearly shows how this new line works.

 

Here we are using string literals. Words or numerals placed between quotes are called string literals. String literals are exactly what they appear to be. They are, literally, meant to represent the very words that you place between the quotes. They are not symbols that stand for something else, such as variables in a math problem do.

The quotes are said to delimit the string. Some languages delimit strings with single quotes, which look like apostrophes. Other languages, including our examples here, use double quotes. Double quotes would be the normal quotes one usually finds in written materials. And some languages let you choose to use single or double quotes for string literals, as long as you start and end the string with the same type.

 

Here is a flow chart for this simple program:

 

Here's how this program code could appear in an imaginary computer language:

    
    printLine("Hello, world.");
    

 

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.