|BASIC has a number of built in functions that greatly extend its capability. These functions perform such varied task as taking the square root of a number, counting the number of characters in a string, and capitalizing letters. Functions associate with one or more values, called input, a single value called output.
Table of Contents
NUMERIC FUNCTIONS: SQR, INT
SQR calculates the square root of a number. The function INT finds the greatest integer less than or equal to a number. Therefore INT discards the decimal parts of a number.
SQR(9) is 3
INT(2.7) is 2
The terms in the parentheses can be numbers (as above), variables, or expressions.
Its full form is absolute. It is used to find the absolute value of a number. Absolute value of a number means the number without a sign.
ABS(+3.4) = 3.4
ABS(- 3.4) = 3.4
RND is a special function that gives us a random number between 0 and 1. This can be used in dice games to make it more interesting.
COS, SIN, TAN, ATN FUNCTIONS
ATN(Arctangent, inverse of TAN)
CONST pi =3.14
It means remainder. This function returns the remainder after division
16 MOD 5 = 1
30 MOD 5 = 0
The EXP function is used to calculate the exponential function i.e raise e to some power, where value of e is 2.13. The general form of exponential is EXP(X). e.g :
EXP(4) = 54.59815
EXP(-5) = 6.73794 E-03
LOG(X) gives the natural logarithm of X
MATHEMATICAL EXPRESSION BASIC NOTATION
|1. List five BASIC functions and what they do
Student are allowed to give corrections to the assessment given by the teacher ,while the teacher support s them in order to guide them