Floating Point Numbers
Numbers such as 1.5 or 3.14159 or 123.821 are called floating point numbers because the decimal point "floats" among the digits to get to the correct location. A number without a decimal point, such as 12 or -23 or 194, is called an integer.
Strings
' Program to write words to the monitor
PRINT "Hello World"
END
In this program the PRINT statement has exactly what you want printed inside quotes (" "). When the program runs, the characters inside the quotes are printed. The quotes are not printed. The "Hello World" is called a string because what you want to print is a string of characters inside the quotes.
What do you suppose this program writes to the computer monitor?
' Program to demonstrate sequential execution
PRINT "Cross patch, draw the latch,"
PRINT "Sit by the fire and spin."
END
PRINT statement can print more than one item. Examine the following program.
' Printing two items
PRINT "The sum of 1 plus 10 is", 1 + 10
END
The PRINT statement has two items to print:
- A string: "The sum of 1 plus 10 is"
- The result of an adding two numbers: 1+10
The two items are separated by a comma ( , ). When the program runs it prints the following to the monitor:
The sum of 1 plus 10 is 11
The string is printed unchanged, character for character. The next item is separated from the first with some spaces, then the result of the arithmetic is printed. It is useful to list two (or more) items in one PRINT statement.