**SUBJECT: I.C.T**

**CLASS: SS 2**

**DATE:**

**TERM: 3rd TERM**

WEEK 2

**TOPIC: BASIC PROGRAMMING I**

**KEYWORDS IN BASIC PROGRAMMING LANGUAGE**

This is also referred to as BASIC statement or a reserved word. It is an instruction in BASIC, which has a specific means to the compiler or interpreter.

**REM STATEMENT**

The REM statement is a remark statement. It is used to insert remarks in the program. Such remarks are used to explain what the program is all about.

**Example:**

10 REM This program finds the average of 5 numbers

**LET STATEMENT**

The LET statement is used to assign (or give) values to variables.

**Examples:**

10 LET A = B + C

**INPUT STATEMENT**

Input is used to assign or give values to variables while program is running. It can be used with both numeric and string variables.

**Examples:**

10 INPUT A, B, C

**PRINT STATEMENT**

The print statement tells your computer to display the output of the executed program on the screen of the monitor (VDU).

**Example:**

10 PRINT SUMS

**END STATEMENT**

End Statement is an instruction used to terminate the program. One the computer encounters END statement, it automatically terminates the program.

50 END

**RUN STATEMENT**

The RUN statement is used to execute a program. In Q-BASIC, F5 is used to RUN a program. Note that the program will not RUN if any mistake or error is detected in it.

**BASIC ARITHMETIC OPERATORS**

The following are arithmetic operators in BASIC organized in their order of execution:

**()**** **Bracket

Ë** **Exponential

/ Division

* Multiplication

+ Addition

- Subtraction

Basic must follow the above order during the execution of the program. In Mathematics, we are familiar with the principle of evaluating algebraic expression using BODMAS but in BASIC programming Language, it is called BEDMAS

**BASIC ARITHMETIC EXPRESSION**

**A**lgebraic expressions are similar in a way to BASIC arithmetic expressions except for differences in some of their operators.

The following are algebraic expressions and their corresponding BASIC arithmetic expression.

Algebraic Expression | BASIC Arithmetic Expression |

a+b | A+B |

a-b | A-B |

a÷b | A/B |

b5 | BË5 |

a=b*h | A=B*H |

X=am-by+c/z | X=A*M-B*Y+C/Z |

A=(-b+d) 2c | A=(-B+D)/(2*C) |

X | X= -B+ (SQR(BË2-4*A*C))/(2*A) X= -B -(SQR(BË2-4*A*C))/(2*A) |

(x-y) (x+y) | (X-Y)/(X+Y) |

**READING ASSIGNMENT: **HiiT @ School, Computer Studies for Senior Secondary Education. Chapter Five, pages 34-36, 110.

**WEEKEND ASSIGNMENT**

**OBJECTIVES**

- ……………….. statement is used to assign (or give) values to variables (a) REM (b) INPUT (c) LET
- ………………… statement is used to execute a program (a) INPUT (b) RUN (c) END
- ………………… Statement is an instruction used to terminate the program. (a) INPUT (b) RUN (c) END
- ……………… principle of evaluating arithmetic expression in BASIC programming Language. (a) BODMAS (b) BODMES (c) BEDMAS
- …………….. statement is used to assign or give values to variables while program is running (a) INPUT (b) RUN (c) END

**THEORY**

- Write the function of the following BASIC keywords (a) LET (b) INPUT (c) PRINT (d) REM (e) RUN
- Rewrite the following algebraic expressions as BASIC arithmetic expression. (a) Y= hk2 (b) (c) (d)

© Lesson Notes All Rights Reserved 2023