Term: 2nd Term
Week: 10
Class: Senior Secondary School 2
Age: 16 years
Duration: 40 minutes of 2 periods each
Date:
Subject: Data Processing
Topic:- Introduction to BASIC programming II
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 functions and its types |
Students pay attention |
STEP 2 EXPLANATION |
He explains the meaning of function in BASIC. He states and explains the types of BUILT-IN functions in BASIC
|
Students pay attention and participates |
STEP 3 DEMONSTRATION |
He further explains what library functions are and how they are used |
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
THE BASIC BUILT-IN FUNCTIONS
BASIC built-in functions are functions that perform a wide range of operations in BASIC.
A function in BASIC is a structure that simplifies a complex operation into a single step. They act as “black boxes” that accept some input value or values and process that input in a defined manner to produce or “return’” an output value.
For example, in the process of taking the square root of a numeric value, if this has to be defined in the program every time a square root is needed, extra code will always be repeated and this can be tiring. But the entire square root operation has now been compressed into a single step using the SQR function as shown below:
DO
INPUT PROMPT “Enter a number:” “:n”
IFn<0 then EXIT DO
RINT “The square root of”; n; “is”; Sqr(n) LOOP
END
Note that the SQR function displays the square root of a numeric value provided by the user.
TYPES OF BASIC BUILT-IN FUNCTIONS
Note that X is the value to be found.
iii. MID$
LIBRARY FUNCTIONS
A library is a file that contains any number or external procedures ( functions, subroutines or pictures) or modules, but no main program .
A library function is the collection of the modules and functions that are stored in the file library.
Importance of Library Functions
How Library Functions are Used
Each library file must begin with an EXTERNAL statement as its first non-comment line. The EXTERNAL statement tells BASIC not to look for a main program in the current file, allowing the library to be compiled separately from the main program
File. Because no main programs are allowed, a library may not contain an END statement.
EVALUATION: 1. Define BASIC BUILT-IN functions
CLASSWORK: As in evaluation
CONCLUSION: The teacher commends the students positively