EasyManuals Logo
Home>Casio>Desktop>FX-890P

Casio FX-890P User Manual

Casio FX-890P
126 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #27 background imageLoading...
Page #27 background image
27
5.2 BASIC Program Configuration
5.2.1 BASIC Program Format
The following is a typical BASIC program, which calculates the volume of a cylinder.
EXAMPLE:
10 REM CYLINDER
20 R=15
30 INPUT “H=”;H
40 V=PI*R^2*H
50 PRINT “V=”;V
60 END
As can be seen, the BASIC program is actually a collection of lines (six lines in the
above program). A line can be broken down into a line number and a statement.
20 R=15
Line Statement
number
Computers execute programs in the order of their line numbers. In the sample
program listed above, the execution sequence is 10, 20, 30, 40, 50, 60. Program
lines can be input into the computer in any sequence, and the computer
automatically arranges the program within its memory in order from the smallest line
number to the highest. Lines can be numbered using any value from 1 to 65535.
20 R=15
40 V=PI*R^2*H
60 END
10 REM CYLINDER
30 INPUT “H=”;H
50 PRINT “V=”;V
10 REM CYLINDER
20 R=15
30 INPUT “H=”;H
40 V=PI*R^2*H
50 PRINT “V=”;V
60 END
Input sequence
Memory contents
Following the line number is a statement or statements which actually tell the
computer which operation to perform. The following returns to the sample program to
explain each statement in detail
10 REM CYLINDER
20 R=15
30 INPUT “H=”;H
40 V=PI*R^2*H
50 PRINT “V=”;V
60 END
REM stands for “remark”. Nothing in this line is executed.
Assigns the constant 15 (radius) to variable R.
Displays H= to prompt a value input for height.
Calculates volume (V) of cylinder.
Prints result of line 40
Ends program.
As can be seen, a mere six lines of programming handles quite a bit of data. Multiple
BASIC program lines can also be linked into a single line using colons.
EXAMPLE:
100 R==15:A=7:B=8
Such a program line is known as “multi-statement”.

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Casio FX-890P and is the answer not in the manual?

Casio FX-890P Specifications

General IconGeneral
BrandCasio
ModelFX-890P
CategoryDesktop
LanguageEnglish

Related product manuals