Topic
BASIC Language
B-A-S-I-C itself is an acronym for
B – Beginners
A – All-purpose
S – Symbolic
I – Instruction
C – Code
This language was developed in 1964 at Dartmouth College, U.S.A by Professor Kemeny and Professor Kurtz. It was designed as a means of teaching students, a simple language for programming in computer that made the language simple, easy-to-learn and easy-to-use programming language with English-like statements and mathematical notations.
There are various versions of BASIC which are as follows:
· Gee Whiz (GW) BASIC
· Q BASIC
· Quick BASIC
· C BASIC
· M BASIC
· BASICA
BASIC Language Character sets consists of all alphabetic character A – Z ,numeric character or value 0 – 9, and special character such as + – * / ( ) < > { } ! % etc
BASIC Statements comprises of the following in details:
1. Remark statement (also known as REM statement): This is used to pass comment in BASIC programming but know that the comment is only meant for the user. This make REM statement to be non-execution statement therefore it is ignored during program execution and is characterized as a dummy statement to the compiler.
Here is the FORMAT:
Line number REM < Command or Instruction >
For example:
10 REM PROGRAM TO ADD FIVE NUMBERS
2. Assignment statement: There are three types and they are; Input, Read and Let statement
I) Input statement: This is an assignment statement that allows data to be fed in from the keyboard into the computer memory. It allows the users to key in numbers on screen separated by commas.
Here is the FORMAT:
Line number INPUT < Numbers or string >
For example:
10 INPUT A, B, C
Sample Program:
10 REM PROGRAM TO ADD TWO NUMBERS
20 INPUT A, B
30 LET C = A+B
40 PRINT C
50 END
II) Let Statement: This is used to assign numerical values or string to a variable name
Here is the FORMAT:
Line number LET < Variable name > = < Numeric value or string >
For example:
20 LET A = B*H/2
III)READ Statement: This statement makes it possible to read a voluminous number of data at the same time, thereby reducing the labour and time consumption, compared to the INPUT and LET statements that are only good for small quantities of data. READ statement goes along with DATA sequentially on the line of codes i.e where there is READ statement, a DATA must be supplied along.
Here is the FORMAT:
Line number READ < Variables>
Line number DATA < Values >
Tests and Exercises
1. BASIC program was developed in which of the following college in the USA?
a. Dartmouth College b. Loyola College c. Georgia College d. Yale College Answer: Dartmouth College
2. Which of the following is not a version of BASIC?
a. Q BASIC b. M BASIC c. Quick BASIC d. Y BASIC Answer: Y BASIC
3. The BASIC statement used in passing comment is known as _________
a. Input statement b. Remark statement c. Let statement d. None of the above. Answer: Remark statement
4. Which of the following is used to assign numerical values to a string?
a. LET Statement b. Input statement c. WRITE statement d. PRINT Statement Answer: LET Statement
5. Where READ statement is used, ________ statement must be used along.
INPUT b. LET c. DATA d. REM. Answer: DATA
For more on classwork notes, click here