Term: 2nd Term
Week: 9
Class: Senior Secondary School 1
Age: 15 years
Duration: 40 minutes of 2 periods each
Date:
Subject: Computer Studies and ICT
Topic:- BASIC Programming language
SPECIFIC OBJECTIVES: At the end of the lesson, pupils should be able to
INSTRUCTIONAL TECHNIQUES: Identification, explanation, questions and answers, demonstration, videos from source
INSTRUCTIONAL MATERIALS: Videos, loud speaker, pictures, Data Processing for senior Secondary Education by Hiit Plc, WAPB Computer Studies for Senior Secondary I by Adekunle et al, On-line Materials.
INSTRUCTIONAL PROCEDURES
PERIOD 1-2
PRESENTATION |
TEACHER’S ACTIVITY |
STUDENT’S ACTIVITY |
STEP 1 INTRODUCTION |
The teacher reviews the previous lesson on the BASIC programming languages |
Students pay attention |
STEP 2 EXPLANATION |
He states the full meaning of BASIC and gives a brief history. He highlights the basic character set and arithmetic and relational operators(functions and uses)
|
Students pay attention and participates |
STEP 3 DEMONSTRATION |
He further explains what data types, keyword, variables and constant are. |
Students pay attention and participate |
STEP 4 NOTE TAKING |
The teacher writes a summarized note on the board |
The students copy the note in their books |
NOTE
BASIC PROGRAMMING LANGUAGE
The BASIC programming language was developed in 1964 by John G. Kemeny and Thomas Kurtz at Dartmouth College. BASIC is an acronym that stands for “Beginner’s All-Purpose Symbolic Instruction Code”
Basic Character Set
A character set is simply a list of letters, numbers and symbols that provide one with the characters used in a particular language. BASIC as a language has its own character set, they include the following:
Arithmetic operators
CHARACTER |
NAME |
USES |
* |
Asterisk |
For multiplication, e.g. A*B or (3*5) |
- |
Minus |
For subtraction, e.g. M-N or (4-1) |
+ |
Plus |
For addition, e.g. K+N or (1+6) |
/ |
Forward slash |
For real division, e.g. A/B or (7/3)=2.33 |
\ |
Bask slash |
For integer division, e.g. P\G or (7\3)=2 |
^ |
Caret |
For exponentiation, e.g. A^B or (7^3) |
Relational (Comparison) Operator
CHARACTER |
NAME |
USES |
= |
Equal to |
A=B |
> |
Greater than |
A>B |
< |
Less than |
A<B |
> = |
Greater than or Equal to |
A >=B |
< = |
Less than or Equal to |
A <= B |
Data types
Data type is a description of the set of values and the basic set of operation that can be applied to values of the type.
iii) Boolean: consist of only two values; “YES and NO” or “True or False” or 1 or 0.
Keyword
Keywords are words that have special meaning and function in BASIC. Such words must be used strictly according to their functions, otherwise the computer will respond with error message.
Here are some of the BASIC keywords and their uses
KEYWORDS |
USES |
EXAMPLE |
REM |
Make comment about an instruction or about the whole program |
10 REM Program to add two numbers |
INPUT |
Used to ask the user to supply the data to be processed while the program is executing |
5 INPUT A,B,C |
|
Used to display the output of operation on the screen |
PRINT “The values”, A,B |
LET |
Used to assign a value to a variable |
3 LET A=5 |
READ |
Used to tell the computer that the data to be processed is supplied within the program statements. Used together with DATA keyword |
10 READ A,B |
DATA |
Used to show the computer the data it is asked to read in the READ statement. Used along with READ keyword. |
10 DATA 4,7 |
END |
To end the program |
5 END |
Variables and Constant
Variable is an identifier or a name of a memory location where data (values) can be placed or stored. Because the value placed in a memory location can be changed at any time, we call such memory location “a variable”. However, when the value of a memory location is not to be changed, we refer to such memory location as “constant”.
Declaration of Variables and Constants
When you are to supply data to the computer for processing, you are required to state the data type. This help the computer to interpret it and an appropriate storage space is reserved for the data. To achieve this, the keyword DIMENSION (or DIM) is used to specify the data type. For example, variable Name and Pie are to hold “character and real” data values respectively. This can be written in BASIC as follows:
Rules for naming Variable
EVALUATION: 1. Write a brief a history on BASIC
CLASSWORK: As in evaluation
CONCLUSION: The teacher commends the students positively