ICT SS1 WK9 PROGRAMMING LANGUAGE II (BASIC)
ICT SS1 WK9 PROGRAMMING LANGUAGE II (BASIC)
Lesson Period: 2
Learning Objectives Previous learning:
At the end of the lesson, Students have been typing and editing text using the
Students should be able to, computer
1. Define Basic
2. State basic Character Set
3. Mention basic Statements
4.
Learning Activities in Steps Learning Skills
Critical thinking, Creative thinking, Problem solving,
Step1: The Topic will be introduced to the students Communicating and Collaborating
Step 2: Students would be taken through the detailed Evaluative Questions
explanation of the lesson 1. What is a Word processor?
Step 3: Students would be allowed to write down notes 2. What are the uses of a Word processor?
Step4: Students would be evaluated based on the Assignments:
behavioral objectives 1. What is the difference between a Word processor and
Word processing?
2. Describe how to load Ms-Word.
3. Practical
The two professors, John Kemeny and Thomas Kurtz developed the language in 1964 at Dartmouth College,
USA, as means of teaching students a simple language for programming a computer.
There are so many versions of BASIC,
i. QBASIC ii. T.BASIC iii. V.BASIC iv. GWBASIC v. Apple Soft BASIC vi. BASICA – (BASIC
ADVANCE)
i. Alphabets: A, B, C, -----, Z and lower case letters (a-z) of the English alphabet.
ii. Digits: 0, 1, 2, ---- 9
iii. BASIC recognizes the following special characters.
# = Number (or pound) sign(suffix for double-precision data type)
$ = Dollar sign (suffix for string data type)
% = Per cent (suffix for string data type)
& = Ampersand
’ = Single quotation mark (apostrophe)
() = Left and right parenthesis
* = Asterisk or multiplication symbol
+ = Plus sign
, = Comma
- = Minus sign
. = Period or decimal
/ = Slash or division
: = Colon
; = Semi-colon
= = Equal sign or assignment symbol
< = Less than
> = Greater than
? = Question mark
@ = At symbol
\ = Backslash or integer division symbol
^ = Up arrow or exponentiation symbol
BASIC Statements
LET Statement
The LET statement permits the programmer to assign numbers and formulas to a variable name.
DATA Statement
The statement (Read and Data) goes hand in hand. Data statement is used to enter data into a program before
running the program or before program execution occurs. The data to be entered into the program is read from
DATA statement.
E.g. 10 READ A, B, C, D
20 DATA 3, 5, 10, 15
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
IF …THEN … ELSE:
Used to perform comparisons or make decision.
DO…LOOP {WHILE} OR {UNTIL}: Repeat a section of code Forever or while/Until the specified condition is true.
GOSUB: Temporarily jumps to a numbered or labeled line, returning to the following line after encountering the
RETURN command. This is used to implement subroutines.
BEEP Statement: The BEEP statement sounds the ASCII bell character.
CLS Statement: This program when executed will clear the screen.
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.
Examples:
Operator Symbol Operation
^ Exponential
* Multiplication
/ Division
+ Addition
- Substraction
Example 3
Write a basic program to calculate and print the sum of two numbers.