0% found this document useful (0 votes)
70 views

Basic Programming Language

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
70 views

Basic Programming Language

Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 8

BASIC

PROGRAMMING
LANGUAGE

Ifunanya Iloh
Objective
s
At the end of this lesson, students should be able to;

•Describe basic programming


•Defend the advantages of basic programming
•Outline five rules of basic programming
•Outline 5 BASIC statements
•Explain and practice each of those BASIC statements
stated in number ‘a’ above
Meaning of BASIC

BASIC stands for Beginner All-purpose Symbolic


Instruction Code. It is not only simple but also a very
powerful high level programming language. It consists
of statements written in English words and
mathematical notation. It is written in a human
understandable form. Its syntax is close to the natural
way of solving some human problems. BASIC was
developed in 1964 by John Kemeny and Thomas Kurtz
at Dartmouth College, USA. Some versions of BASIC
are QBASIC, Visual BASIC.
Rules for BASIC programming
1. All expressions must be written in capital letters.
2. First character must be alphabet
3. BASIC statement or keyword must start with a line
number.
4. Each line must contain only one BASIC program
statement.
5. There must not be full stop at the end of a
statement.
6. The start/begin statement must be the first entry in
a program.
7. End/Stop statement must be the last entry in a
program.
Elements of BASIC
1. Character Set
This refers to any letter, number, sign or symbol and
punctuation mark in any language used for representation of
information. Character set are: Numbers 0 - 9, Alphabets A -
Z, Special characters or symbols +, -, *, /, <, &, :, ; etc

2. Data Constants & Data Variables


i. Data Constant (or constants): These are data that do not
change during the course of computation or program
execution.
ii. Data Variables (variables): They are data that can change in
constant numerals versus variable numerals.
Examples of High level Languages
Constant data Variables data
10 A = 1 10 Input A
20 B = 2 20 Input B
30 Sum = A + B 30 Sum = A + B
40 PRINT SUM, A, B 40 PRINT SUM,A, B
50 END 50 END
3. Reserved or Keyword:
This is also referred to as a BASIC statement. It is an
instruction which has special meaning to the computer or
BASIC interpreter. Examples: REM, LET, INPUT, READ,etc.
Key BASIC Statement

1. LINE numbers
2. REM Statement (Remark)
3. ASSIGNMENT Statement
4. INPUT Statement
5. LET Statement
6. DATA Statement
7. OUTPUT Statement
8. PROGRAM TERMINATOR (END, STOP)
Structure of BASIC program
1. 1. One instruction or statement per line
2. Each line must begin with a line number
3. Line numbers are unsigned positive integers
4. Line number should increase in steps of 10 to allow for insertion
of extra lines during program modification.
Examples:
Write a program to calculate the average of x,y and z as 46, 73
and 114 respectively.
10 x = 46
20 y = 73
30 z = 114
40 AVERAGE = (x+y+z)/3
50 END
RUN

You might also like