jss 2 week 2 i.c.t note
jss 2 week 2 i.c.t note
Meaning of BASIC
BASIC stands for Beginner All-purpose Symbolic Instruction Code. It consists of statements
written in English words and mathematical notation. Its syntax is close to the natural way of
solving some human problems.
Rules for BASIC programming
1. All expressions must be written in capital letters.
2. First character must be alphabet
3. BASIC statement or keyword must start with a line number.
4. Each line must contain only one BASIC program statement.
5. There must not be full stop at the end of a statement.
6. The start/begin statement must be the first entry in a program.
7. End/Stop statement must be the last entry in a program.
Element of BASIC
1. Character Set: This refers to any letter, number, sign or symbol and punctuation mark
in any language used for representation of information. Character set are: Numbers 0-9,
Alphabets A - Z, Special characters or symbols +, -, &, :, ; etc
3. Reserved or Keyword:
This is also referred to as a BASIC statement. It is an instruction which has special
meaning to the computer or BASIC interpreter. Examples: REM, LET, INPUT, READ,
etc.
i. LINE numbers: In BASIC we need a line number for each basic statement. Numbers
are positive whole numbers from 1 to 99,999. A line number is always in integer form and this
are done to give room for correction when necessary. It is presented in the format below:
10 ……………………..
20 ……………………..
30 ……………………..
40 …………………….. etc.
ii. REM Statement (Remark): REM statements stand for remark. The statement allows
you to add comment and explanatory notes to your program. This may as well include date and
what the program is all about. Computer does not execute REM; it is just a remark that aids the
programmer to remember certain thing about the program.
Examples: REM PROGRAMM TO SAY HELLO
REM TO CALCULATE AREA OF A TRIANGLE
INPUT Statement
This allows you to type in data from the keyboard while the program is running. This program
will be able to produce the required result with given data. The input statements have the
general format.
10 INPUT A
20 INPUT B
30 INPUT C
LET Statement
The LET statement permits the programmer to assign numbers and formulas to a variable
name.
HOME WORK
a) Explain the meaning of BASIC Programming
b) Explain the Meaning of BASIC
c) Mention the Rules for BASIC programming