SUBJECT: I.C.
CLASS: SS 2
DATE:
TERM: 3rd TERM
WEEK 3
TOPIC: BASIC PROGRAMMING II
BASIC BUILT IN FUNCTIONS
These are Mathematical functions that are built into BASIC. Some common BASIC functions are shown
below:
1. SQR( )
2. ABS( )
3. LOG ( )
4. SIN ( )
5. COS ( )
6. TAN ( )
7. INT ( )
8. RND ( )
9. EXP ( )
SIMPLE BASIC PROGRAM TO ILLUSTRATE BUILT-IN FUNCTION
SQR – Finds the square root of a positive number.
10 PRINT SQR (275)
ABS – This displays the absolute value of a given number.
10 CLS
20 LET A = 10
30 LET B = 12
40 LET C = A + B
50 PRINT ABS(C)
60 END
LOG – Using natural logarithm.
10 CLS
20 PRINT LOG (56.5)
SIN – Finds the Sine of an angle.
10 CLS
20 PRINT SIN (45)
COS – Finds the Cosine of an angle.
10 CLS
20 PRINT COS (92)
TAN – Finds the tangent of an angle.
10 CLS
20 PRINT TAN (108)
EXP – Finds the exponential of a number.
10 CLS
20 PRINT EXP (4)
30 END
INT – Finds the integer of a real number.
10 CLS
20 PRINT INT (258.36)
30 END
READING ASSIGNMENT: HiiT @ School, Computer Studies for Senior Secondary Education. Chapter Five,
pages 110.
WEEKEND ASSIGNMENT
OBJECTIVES
1. ………………… is a BASIC built in function used to find the integer of a real number. (a) INT (b) EXP (c)
TAN (d) COS
2. ………………… is a BASIC built in function used to find the tangent of a real number. (a) INT (b) EXP (c)
TAN (d) COS
3. ………………… is a BASIC built in function used to find the logarithm of a real number. (a) INT (b) EXP
(c) LOG (d) COS
4. ………………… is a BASIC built in function used to find the exponential of a real number. (a) EXP (b) TAN
(c) COS (d) SIN
5. ………………… is a BASIC built in function used to find the Sine of a real number. (a) EXP (b) TAN (c)
COS (d) SIN
THEORY
1. Write a BASIC program to compute the square root of numbers from 10 to 40
2. List and explain four (4) BASIC built in functions.