CARA'S TIPS
Computer Studies / Data Processing · Lesson 8

Languages, algorithms, flowcharts and BASIC programming

JAMBWAECNECO

What the syllabus asks

JAMB: Section G Developing problem-solving skills 1 Programming languages (machine, assembly, high-level: BASIC, C, Java, Fortran 2008, Python, Perl; advantages and disadvantages); 2 High-level languages (classifications; characteristics; translators: interpreters, compilers); 3 Algorithms and flowcharts (definitions; functions; properties: input, output, definiteness, effectiveness, finiteness;…

WAEC: Programming languages (ML, LLL, HLL; classification; features of BASIC, C, Pascal, COBOL); algorithm and flowchart (average of a set, y=a(b-c)²/(d+2), first ten odd numbers); BASIC (acronym, characteristics, data types, INPUT, PRINT, LPRINT, LET, END, REM, READ, DATA; operators; expressions; area of triangle and rectangle, average of 3; built-in functions SQR, INT, SIN, ABS, RND, COS, TAN, LOG,…

NECO: Programming languages (ML, LLL, HLL; classification; features of BASIC, C, Pascal, COBOL); algorithm and flowchart (average of a set, y=a(b-c)²/(d+2), first ten odd numbers); BASIC (acronym, characteristics, data types, INPUT, PRINT, LPRINT, LET, END, REM, READ, DATA; operators; expressions; area of triangle and rectangle, average of 3; built-in functions SQR, INT, SIN, ABS, RND, COS, TAN, LOG,…

What you will learn

Key points

Start here: Programs and levels of programming language

A program is a set of instructions, written in the right order, that tells a computer how to carry out a task or solve a problem. A programming language is a set of words, symbols and grammar rules (syntax) for writing those instructions. Writing programs is programming, and the person is a programmer.

1. Machine language (ML), first generation

Instructions written entirely in binary, e.g. 100011001 (WAEC’s example). Each processor family has its own machine code. Advantages: executed directly with no translation, so it runs fastest; uses memory efficiently. Disadvantages: very hard to write, read and debug; the programmer must know the hardware in detail; programs are machine dependent (not portable).

2. Low-level (assembly) language, second generation

Uses short words called mnemonics in place of binary: MOV (move), ADD, SUB, JMP (jump), with symbolic names for memory. An assembler translates it into machine code; JAMB describes assembly as a “thin wrapper” over machine language because each instruction usually matches one machine instruction. Advantages: easier than binary; fast and compact; gives direct control of hardware (used for device drivers and embedded systems). Disadvantages: still machine dependent, tedious and needs a translator.

3. High-level languages (HLL), third generation and above

English-like statements and ordinary mathematical notation, e.g. LET AREA = L * B. Examples: BASIC, FORTRAN, COBOL, Pascal, C, C++, Java, Python, Perl. Advantages: easy to learn, read, write, debug and maintain; machine independent (portable); one statement does the work of many machine instructions; built-in functions and data structures. Disadvantages: must be translated by a compiler or interpreter; the translated program is usually slower and larger than hand-written assembly; less direct hardware control.

Levels of programming languageMachine10110000 01100001AssemblyMOV AL, 61hHigh-levelLET A = 97hardware runs itneeds assemblercompiler/interpreter← closer to the machine closer to English →
FeatureMLAssemblyHLL
Form0s and 1smnemonicsEnglish-like
Translatornoneassemblercompiler / interpreter
Portabilitynonenonehigh
Ease of usehardesthardeasiest
Speed of executionfastestfastslower

Fourth-generation languages (4GLs) such as SQL (cs6) let users say what they want rather than how to get it.

Continue this lesson in the free app →

Practice questions

1. A language made of 0s and 1s that the CPU executes directly is
  1. machine language
  2. assembly language
  3. BASIC
  4. COBOL
Show answer

A: machine language
Low-level, no translation needed.

2. BASIC stands for
  1. Basic Algorithmic System for Instruction Coding
  2. Binary Assembly Symbolic Interpreted Code
  3. Beginner’s Automatic Simple Instruction Code
  4. Beginner’s All-purpose Symbolic Instruction Code
Show answer

D: Beginner’s All-purpose Symbolic Instruction Code
Created at Dartmouth in 1964.

3. The flowchart symbol for a decision is a
  1. parallelogram
  2. oval
  3. diamond
  4. rectangle
Show answer

C: diamond
Rectangle = process; parallelogram = input/output.

4. The flowchart symbol for input/output is a
  1. circle
  2. parallelogram
  3. diamond
  4. rectangle
Show answer

B: parallelogram
Oval = start/stop; diamond = decision.

5. Which BASIC variable can hold text?
  1. N$
  2. N
  3. N%
  4. N!
Show answer

A: N$
$ marks a string variable.

Key words

Program
A set of instructions that directs a computer to solve a problem.
Programming language
A formal notation for writing programs.
Machine language
Binary instructions the processor executes directly.
Assembly language
A low-level language using mnemonics such as ADD and MOV.
Assembler
Translates assembly language into machine code.
High-level language
A machine-independent, English-like language such as BASIC or Python.
Compiler
Translates a whole high-level program into machine code before execution.
Interpreter
Translates and executes a program one statement at a time.
Source program
The program as written by the programmer.
Object program
The machine-code program produced by a compiler.
Algorithm
A finite, ordered set of unambiguous steps to solve a problem.
Flowchart
A diagram of an algorithm drawn with standard symbols.
Learn Languages, algorithms, flowcharts and BASIC programming step by step, free.
The Cara's Tips app teaches every topic from the very basics, with quick checks, worked examples and exam practice. It works offline.
Open this lesson in the free appDownload for Android