Program Documentation: Internal and External Documentation

A program that works is good – but a program that works and is easy for others to understand is much better. Documentation is the written explanation that goes with a program. In this post you will learn the two types: internal and external documentation.

Build on what you learned in Forms 1–3

These Lower School ICT posts cover the basics of this topic:

In this post:

  • Why document a program?
  • Internal documentation
  • External documentation
  • A well-documented program in Python and C

Why document a program?

  • Other programmers (or you, months later!) can understand and maintain the program.
  • Users can learn how to install and use the program.
  • Errors are easier to find and fix.

Internal documentation

Internal documentation is written inside the source code. It includes:

  • Comments – notes that the translator ignores. In Python they start with #; in C they go between /* and */ (or after //).
  • A header comment at the top: program name, author, date and purpose.
  • Meaningful variable names such as rate_per_km instead of r.
  • Indentation and white space so the structure (IFs and loops) is easy to see.

External documentation

External documentation is separate from the code. It includes:

  • User documentation (user manual or help files) – tells users how to install, start and use the program, with screenshots and troubleshooting tips.
  • Technical documentation – for programmers: the algorithms, flowcharts, IPO charts, data types used and test results.

A well-documented program

Python

# ------------------------------------------------------------
# Program:  Taxi fare calculator
# Author:   A. Student
# Date:     16 October 2026
# Purpose:  Works out a taxi fare from the distance travelled.
#           Fare = base fee + (rate per km x distance)
# ------------------------------------------------------------

BASE_FEE = 5.00       # fixed charge for every trip ($)
RATE_PER_KM = 2.50    # charge for each kilometre ($)

# Input: distance in kilometres
distance = float(input("Enter distance travelled (km): "))

# Process: calculate the fare
fare = BASE_FEE + RATE_PER_KM * distance

# Output: display the fare to 2 decimal places
print("Fare: $" + format(fare, ".2f"))

C

/* ------------------------------------------------------------
   Program:  Taxi fare calculator
   Author:   A. Student
   Date:     16 October 2026
   Purpose:  Works out a taxi fare from the distance travelled.
             Fare = base fee + (rate per km x distance)
   ------------------------------------------------------------ */
#include <stdio.h>

#define BASE_FEE 5.00      /* fixed charge for every trip ($) */
#define RATE_PER_KM 2.50   /* charge for each kilometre ($)   */

int main(void)
{
    float distance, fare;

    /* Input: distance in kilometres */
    printf("Enter distance travelled (km): ");
    scanf("%f", &distance);

    /* Process: calculate the fare */
    fare = BASE_FEE + RATE_PER_KM * distance;

    /* Output: display the fare to 2 decimal places */
    printf("Fare: $%.2f\n", fare);
    return 0;
}

Sample run with 12 km: Fare: $35.00. Notice the header comment, the comments for input, processing and output, the named constants and the meaningful variable names.

How large software teams organise and document code so that many people can work on it.

Video: Software Engineering: Crash Course Computer Science #16 – https://www.youtube.com/watch?v=O753uuutqH8

Try it: Internal or external documentation?

Classify each item.

A comment explaining what a loop does
A printed user manual for a school library program
Using the variable name total_sales instead of ts
An online help page with screenshots
A header comment with the author and date
A flowchart of the program kept in a design report

Paper 1 practice (multiple choice)

Choose the best answer for each question. Try them all before you check.

1. Comments written inside the source code are an example of
(A) external documentation
(B) internal documentation
(C) a user manual
(D) test data

2. Which is an example of external documentation?
(A) Indentation
(B) A user manual
(C) Meaningful variable names
(D) A comment

3. In Python, a comment begins with
(A) //
(B) /*
(C) #
(D) REM

4. ONE purpose of program documentation is to
(A) make the program run faster
(B) help others understand and maintain the program
(C) remove syntax errors automatically
(D) translate the program

5. Which variable name is the MOST meaningful?
(A) x
(B) tp
(C) total_price
(D) a1

Show answers

1. B
2. B
3. C
4. B
5. C

Paper 2 practice (structured question)

A programmer has written a program to calculate the monthly salaries of workers at a factory in San Fernando. The program will be used by the payroll clerk and updated by other programmers in the future.

(a) Distinguish between internal and external documentation. (2 marks)

(b) Give TWO examples of internal documentation the programmer should include. (2 marks)

(c) State TWO items that should be included in the user manual for the payroll clerk. (2 marks)

(d) Explain why documentation is important for the programmers who will update the program in the future. (2 marks)

Total: 8 marks

Show answers

(a) Internal documentation is written within the source code (1 mark); external documentation is separate from the code, e.g. manuals (1 mark).

(b) Any two (1 mark each):
• comments
• a header comment (name, author, date, purpose)
• meaningful variable names
• indentation/white space

(c) Any two (1 mark each):
• how to install/start the program
• how to enter workers’ data
• how to print payslips/reports
• error messages and troubleshooting
• system requirements

(d) It helps them understand what each part of the program does (1 mark), so they can make changes and fix errors more quickly and safely (1 mark).

Previous: Declaring Variables and Translating Algorithms into Python and C
Back to CSEC Information Technology Notes

Syllabus link: This post is relevant to the CSEC® Information Technology Syllabus (CXC 30/G/SYLL 17), Section 8: Program Implementation, Specific Objective 6 (“effectively document programs”).

Attributions to media used in this post:

No third-party images are used in this post. Embedded videos are credited on YouTube to their channels.

Updates

2026/11/23

– Added Previous, Next and Back to course links at the end of the lesson.

2026/10/16

– Author name in example programs changed to a generic student name.
– Syntax highlighting added to code examples.

© 2026 Vedesh Kungebeharry. All rights reserved.

Declaring Variables and Translating Algorithms into Python and C

This is where it all comes together: you take an algorithm written in pseudocode and translate it into a real program. We will do every example in Python and C side by side, so you can see how each pseudocode statement becomes code.

Build on what you learned in Forms 1–3

These Lower School ICT posts cover the basics of this topic:

In this post:

  • Declaring variables and constants
  • A pseudocode-to-code translation table
  • Worked example 1: sequence (average of 3 scores)
  • Worked example 2: selection inside a WHILE loop (counting passes)

Declaring variables and constants

To declare a variable means to give it a name and (in many languages) a data type, so the computer sets aside memory for it.

  • In C you must declare each variable with its type before using it: int (integer), float (real), char (character), char name[20] (string), bool (Boolean, with #include <stdbool.h>). Constants can be made with #define PASS_MARK 50 or const int PASS_MARK = 50;.
  • In Python a variable is created when you first assign a value to it, and Python works out the type: age = 15 (int), price = 12.5 (float), name = "Kezia" (str), paid = True (bool). Constants are written in CAPITALS by convention: PASS_MARK = 50.

Python

# Declaring (creating) variables and a constant in Python
SCHOOL_NAME = "Island Secondary"   # constant (by convention, CAPITALS)
age = 15                            # integer
height = 1.62                       # real (float)
grade = 'A'                         # character (a string of length 1)
name = "Kezia"                      # string
is_prefect = True                   # Boolean
print(name, "is", age, "years old and got grade", grade)
print("Height:", height, "m  Prefect:", is_prefect, " School:", SCHOOL_NAME)

C

/* Declaring variables and a constant in C */
#include <stdio.h>
#include <stdbool.h>

#define SCHOOL_NAME "Island Secondary"   /* constant */

int main(void)
{
    int age = 15;              /* integer */
    float height = 1.62;       /* real */
    char grade = 'A';          /* character */
    char name[20] = "Kezia";   /* string (array of characters) */
    bool is_prefect = true;    /* Boolean (1 = true, 0 = false) */

    printf("%s is %d years old and got grade %c\n", name, age, grade);
    printf("Height: %.2f m  Prefect: %d  School: %s\n", height, is_prefect, SCHOOL_NAME);
    return 0;
}

Translation table

PseudocodePythonC
READ ageage = int(input())scanf(“%d”, &age);
READ priceprice = float(input())scanf(“%f”, &price);
PRINT “Total: “, totalprint(“Total:”, total)printf(“Total: %.2f\n”, total);
total ← 0total = 0total = 0;
IF x > 5 THEN … ELSE … ENDIFif x > 5:
    …
else:
    …
if (x > 5) { … } else { … }
FOR i ← 1 TO 10 DO … ENDFORfor i in range(1, 11):for (i = 1; i <= 10; i++) { … }
WHILE x <> -1 DO … ENDWHILEwhile x != -1:while (x != -1) { … }
a AND b, a OR b, NOT aa and b, a or b, not aa && b, a || b, !a
x MOD y, x DIV yx % y, x // yx % y, x / y (both integers)

Remember: Python uses indentation (spaces) to show which lines belong inside an IF or a loop; C uses curly braces { } and ends each statement with a semicolon.

Worked example 1: average of three scores (sequence)

Pseudocode

START
    READ score1, score2, score3
    average ← (score1 + score2 + score3) / 3
    PRINT "The average is ", average
STOP

Python

# Find the average of three test scores
score1 = float(input("Enter score 1: "))
score2 = float(input("Enter score 2: "))
score3 = float(input("Enter score 3: "))
average = (score1 + score2 + score3) / 3
print("The average is", format(average, ".2f"))

C

/* Find the average of three test scores */
#include <stdio.h>

int main(void)
{
    float score1, score2, score3, average;

    printf("Enter score 1: ");
    scanf("%f", &score1);
    printf("Enter score 2: ");
    scanf("%f", &score2);
    printf("Enter score 3: ");
    scanf("%f", &score3);

    average = (score1 + score2 + score3) / 3;
    printf("The average is %.2f\n", average);
    return 0;
}

Sample run: scores 60, 70 and 85 → The average is 71.67.

Worked example 2: counting passes (WHILE loop with selection)

Pseudocode

PASS_MARK ← 50
count ← 0
passed ← 0
READ mark
WHILE mark <> -1 DO
    count ← count + 1
    IF mark >= PASS_MARK THEN
        PRINT "Pass"
        passed ← passed + 1
    ELSE
        PRINT "Fail"
    ENDIF
    READ mark
ENDWHILE
PRINT passed, " out of ", count, " students passed"

Python

# Count how many students passed (mark of 50 or more).
# Enter -1 to stop.
PASS_MARK = 50
count = 0
passed = 0
mark = int(input("Enter mark (-1 to stop): "))
while mark != -1:
    count = count + 1
    if mark >= PASS_MARK:
        print("Pass")
        passed = passed + 1
    else:
        print("Fail")
    mark = int(input("Enter mark (-1 to stop): "))
print(passed, "out of", count, "students passed")

C

/* Count how many students passed (mark of 50 or more).
   Enter -1 to stop. */
#include <stdio.h>

#define PASS_MARK 50

int main(void)
{
    int mark, count = 0, passed = 0;

    printf("Enter mark (-1 to stop): ");
    scanf("%d", &mark);
    while (mark != -1)
    {
        count = count + 1;
        if (mark >= PASS_MARK)
        {
            printf("Pass\n");
            passed = passed + 1;
        }
        else
        {
            printf("Fail\n");
        }
        printf("Enter mark (-1 to stop): ");
        scanf("%d", &mark);
    }
    printf("%d out of %d students passed\n", passed, count);
    return 0;
}

Sample run with 72, 45, 50 then −1: Pass, Fail, Pass, then 2 out of 3 students passed. Notice that the mark of 50 (a boundary value) correctly gives “Pass”.

Try running these yourself. You can install Python (IDLE or Thonny) and a C compiler such as gcc or Code::Blocks, or use an online editor.

Try it: Pseudocode to code

Choose the correct Python or C statement for each pseudocode line.

READ age (Python)
PRINT total (C, total is an integer)
IF mark >= 50 THEN (Python)
WHILE n <> 0 DO (C)
FOR i ← 1 TO 5 DO (Python)
Declare a real variable called price (C)

Related

Related: Demo: Constants, Variables and Datatypes.; Python Example: Indefinite prompting to determine the corresponding grade for a given mark

Paper 1 practice (multiple choice)

Choose the best answer for each question. Try them all before you check.

1. Which C statement declares an integer variable called count?
(A) count int;
(B) int count;
(C) integer count
(D) declare count

2. In Python, which statement reads a whole number from the user?
(A) num = input(int)
(B) num = int(input())
(C) scanf(num)
(D) READ num

3. The pseudocode operator <> is written in Python and C as
(A) =
(B) ==
(C) !=
(D) <>

4. Which C data type is used for a real number such as 12.75?
(A) int
(B) char
(C) float
(D) bool

5. In Python, the lines inside an if statement are shown by
(A) curly braces
(B) semicolons
(C) indentation
(D) ENDIF

Show answers

1. B
2. B
3. C
4. C
5. C

Paper 2 practice (structured question)

The following pseudocode finds the total cost of tickets for a school concert:

READ num_tickets
cost ← num_tickets * 40
IF num_tickets >= 10 THEN
    cost ← cost - 50
ENDIF
PRINT cost

(a) Write a declaration, in a high-level language of your choice, for:

(i) the variable num_tickets (1 mark)

(ii) the variable cost (1 mark)

(b) Explain why the ticket price of $40 could be declared as a constant. (1 mark)

(c) Translate the pseudocode into a high-level language of your choice. (5 marks)

(d) State the output when num_tickets is 12. (2 marks)

Total: 10 marks

Show answers

(a)

(i) Int num_tickets; (in C) or num_tickets = 0 (in Python) (1 mark)

(ii) Int cost; or float cost; (in C) or cost = 0 (in Python) (1 mark)

(b) The price does not change while the program runs, so storing it as a constant makes the program easier to read and update (1 mark).

(c)
• Reading num_tickets correctly, e.g. num_tickets = int(input()) or scanf("%d", &num_tickets); (1 mark)
• cost = num_tickets * 40 (1 mark)
• if num_tickets >= 10 with correct syntax (1 mark)
• cost = cost - 50 inside the if (1 mark)
• print(cost) or printf("%d", cost); (1 mark)

(d) 12 × 40 = 480 (1 mark); 480 − 50 = 430, so 430 is printed (1 mark).

Previous: Program Errors, Testing and Debugging: Syntax, Logic and Runtime Errors
Next: Program Documentation: Internal and External Documentation
Back to CSEC Information Technology Notes

Syllabus link: This post is relevant to the CSEC® Information Technology Syllabus (CXC 30/G/SYLL 17), Section 8: Program Implementation, Specific Objectives 4 and 5 (“declare variables and constants using elementary data types” and “translate algorithmic statements into high-level language syntax”).

Attributions to media used in this post:

No third-party images are used in this post. Embedded videos are credited on YouTube to their channels.

Updates

2026/11/23

– Added Previous, Next and Back to course links at the end of the lesson.

2026/10/16

– Syntax highlighting added to code examples.

© 2026 Vedesh Kungebeharry. All rights reserved.

Program Errors, Testing and Debugging: Syntax, Logic and Runtime Errors

Almost no program works perfectly the first time – not even for professional programmers! In this post you will learn the three types of program errors, how to choose good test data, and some techniques for debugging (finding and fixing errors).

Build on what you learned in Forms 1–3

These Lower School ICT posts cover the basics of this topic:

In this post:

  • Syntax errors
  • Logic errors
  • Runtime errors
  • Test data: normal, boundary and erroneous
  • Debugging techniques
The famous “first computer bug”: a moth found trapped in the Harvard Mark II computer in 1947 and taped into the log book. Finding and fixing errors is still called debugging.
The famous “first computer bug”: a moth found trapped in the Harvard Mark II computer in 1947 and taped into the log book. Finding and fixing errors is still called debugging.

Image source: File:H96566k.jpg

Syntax errors

A syntax error happens when the rules (grammar) of the programming language are broken – for example a missing bracket, a missing semicolon or a misspelt keyword like pritn. The translator finds these errors, and the program will not run until they are fixed.

Python

print("Hello, Trinidad!"    # missing closing bracket

C

#include <stdio.h>

int main(void)
{
    printf("Hello, Trinidad!\n")    /* missing semicolon */
    return 0;
}

Python reports SyntaxError: '(' was never closed. The C compiler (gcc) reports error: expected ';' before 'return'.

Logic errors

A logic error is a mistake in the design of the program. The program runs, but gives the wrong result. The computer cannot spot it for you – you find it by testing and comparing with the expected answer (a trace table helps!).

Python

# Logic error: the brackets are missing, so only score3 is divided by 3
score1 = 60
score2 = 70
score3 = 80
average = score1 + score2 + score3 / 3     # WRONG - gives 156.67
print("Average:", average)
average = (score1 + score2 + score3) / 3   # CORRECT - gives 70.0
print("Average:", average)

C

/* Logic error: the brackets are missing, so only score3 is divided by 3 */
#include <stdio.h>

int main(void)
{
    float score1 = 60, score2 = 70, score3 = 80, average;

    average = score1 + score2 + score3 / 3;     /* WRONG - gives 156.67 */
    printf("Average: %.2f\n", average);
    average = (score1 + score2 + score3) / 3;   /* CORRECT - gives 70.00 */
    printf("Average: %.2f\n", average);
    return 0;
}

Both programs print 156.67 for the wrong line and 70 for the correct line. Other common logic errors: using > instead of >=, or a loop that runs one time too many.

Runtime errors

A runtime error happens while the program is running and usually makes it crash. Examples: dividing by zero, trying to open a file that does not exist, or a user typing letters when a number was expected.

Python program with a runtime error

# Runtime error: dividing by zero crashes the program while it runs
total_marks = int(input("Total marks: "))
num_students = int(input("Number of students: "))
print("Class average:", total_marks / num_students)

If the user enters 0 students, Python stops with ZeroDivisionError: division by zero. A good programmer checks the input first:

Python

# Fixed: check the value before dividing
total_marks = int(input("Total marks: "))
num_students = int(input("Number of students: "))
if num_students > 0:
    print("Class average:", total_marks / num_students)
else:
    print("Number of students must be more than 0")

C

/* Fixed: check the value before dividing */
#include <stdio.h>

int main(void)
{
    int total_marks, num_students;

    printf("Total marks: ");
    scanf("%d", &total_marks);
    printf("Number of students: ");
    scanf("%d", &num_students);
    if (num_students > 0)
        printf("Class average: %.2f\n", (float) total_marks / num_students);
    else
        printf("Number of students must be more than 0\n");
    return 0;
}

Sample run with 300 and 0: Number of students must be more than 0.

Test data

Type of test dataMeaningExample for marks 0–100 with pass mark 50
NormalTypical, valid values the program should accept35, 72, 88
Boundary (extreme)Values at the edges of the valid range0, 49, 50, 100
Erroneous (abnormal)Invalid values the program should reject−5, 150, “abc”

Debugging techniques

  • Read the error messages – they usually give the line number.
  • Dry run with a trace table – follow the code by hand to see where values go wrong.
  • Print statements – temporarily display the values of variables at different points.
  • Use a debugger – step through the program line by line and watch the variables (IDEs such as Thonny or Code::Blocks have this).
  • Test small parts one at a time.

Try it: Error-type sorter

Decide whether each problem is a syntax, logic or runtime error.

The keyword print is typed as prnt
The program uses > 50 instead of >= 50, so a mark of 50 shows “Fail”
The program crashes when the user enters 0 as the number to divide by
A closing bracket is missing at the end of a line
The total is calculated as price + quantity instead of price * quantity
The program crashes because a file it must open has been deleted

Related

Related: How to Approach a Dry run using test data and trace tables to uncover errors in your algorithm

Paper 1 practice (multiple choice)

Choose the best answer for each question. Try them all before you check.

1. A missing semicolon in a C program is an example of a
(A) logic error
(B) syntax error
(C) runtime error
(D) linking error

2. A program runs but displays the wrong total. This is MOST likely a
(A) syntax error
(B) logic error
(C) runtime error
(D) compiler error

3. Dividing a number by zero while a program is running causes a
(A) syntax error
(B) logic error
(C) runtime error
(D) typing error

4. For a program that accepts ages 13 to 19, which is BOUNDARY test data?
(A) 15
(B) 13
(C) 25
(D) −2

5. The process of finding and correcting errors in a program is called
(A) compiling
(B) linking
(C) debugging
(D) documenting

Show answers

1. B
2. B
3. C
4. B
5. C

Paper 2 practice (structured question)

A program is written to accept a student’s mark from 0 to 100 and display “Pass” for marks of 50 and over.

(a) Distinguish between a syntax error and a logic error. (2 marks)

(b) Give ONE example of:

(i) a runtime error (1 mark)

(ii) a logic error that could occur in this program (1 mark)

(c) Suggest ONE value of EACH type of test data for this program:

(i) normal (1 mark)

(ii) boundary (1 mark)

(iii) erroneous (1 mark)

(d) Describe TWO debugging techniques a programmer could use. (2 marks)

Total: 9 marks

Show answers

(a) A syntax error breaks the rules of the programming language and is found by the translator (1 mark); a logic error lets the program run but gives incorrect results (1 mark).

(b)

(i) The program crashes when the user types letters instead of a number (1 mark)

(ii) Using > 50 instead of >= 50 so a mark of 50 shows “Fail” (1 mark)

(c)

(i) A typical valid mark such as 72 (1 mark)

(ii) 0, 49, 50 or 100 (1 mark)

(iii) Any value below 0 or above 100, e.g. 150 (1 mark)

(d) Any two (1 mark each):
• dry run with a trace table
• adding print statements to display variable values
• using a debugger to step through the code
• reading error messages and line numbers
• testing small parts separately

Previous: Low-Level vs High-Level Languages and the Steps in Implementing a Program
Next: Declaring Variables and Translating Algorithms into Python and C
Back to CSEC Information Technology Notes

Syllabus link: This post is relevant to the CSEC® Information Technology Syllabus (CXC 30/G/SYLL 17), Section 8: Program Implementation, Specific Objective 3 (“perform checks and tests on programs to verify correctness”).

Attributions to media used in this post:

  • H96566k.jpg – Courtesy of the Naval Surface Warfare Center, Dahlgren, VA., 1988. – Public domain (via Wikimedia Commons)

Updates

2026/11/23

– Added Previous, Next and Back to course links at the end of the lesson.

2026/10/16

– Syntax highlighting added to code examples.

© 2026 Vedesh Kungebeharry. All rights reserved.

Low-Level vs High-Level Languages and the Steps in Implementing a Program

You now know how to design an algorithm. Section 8 is about turning it into a working program. First we look at the different types of programming languages, and then at the steps from typing the code to running it.

Build on what you learned in Forms 1–3

These Lower School ICT posts cover the basics of this topic:

In this post:

  • Low-level languages: machine language and assembly language
  • High-level languages
  • Translators: compilers, interpreters and assemblers
  • The steps in implementing a program

Low-level languages

A low-level language is close to what the computer’s hardware understands.

  • Machine language – instructions written in binary (0s and 1s), e.g. 10110000 01100001. The CPU can run it directly, but it is very hard for people to read and write, and it is different for each type of processor.
  • Assembly language – uses short codes called mnemonics, e.g. MOV, ADD, LOAD. It is easier than binary but still tied to one type of processor, and must be changed into machine code by an assembler.
A punched card from a Fortran program. Early programmers typed each line of code onto a card like this, and the computer read the holes.
A punched card from a Fortran program. Early programmers typed each line of code onto a card like this, and the computer read the holes.

Image source: File:FortranCardPROJ039.agr.jpg

High-level languages

A high-level language uses English-like words and normal maths symbols, so it is easier to learn, read and fix. Examples: Python, C, Pascal, Java, Visual Basic. The same program can run on different types of computers (it is portable), but it must be translated into machine code first.

Low-levelHigh-level
Close to machine code; hard for people to understandEnglish-like; easier to read and write
Machine-dependent (works on one type of processor)Portable (can run on different computers)
Runs very fast and uses little memoryMust be translated; may run slightly slower
Slow to write and hard to debugFaster to write and easier to debug

Here is the same tiny program in two high-level languages:

Python

print("Hello, Caribbean!")

C

#include <stdio.h>

int main(void)
{
    printf("Hello, Caribbean!\n");
    return 0;
}

Both print Hello, Caribbean! – C needs a little more structure (the main function, semicolons and return 0).

How programming moved from machine code to assembly language and then to high-level languages, including the work of Grace Hopper.

Video: The First Programming Languages: Crash Course Computer Science #11 – https://www.youtube.com/watch?v=RU1u-js7db8

Translators

  • Compiler – translates the whole high-level program into machine code (object code) before it runs; the result can then be run many times. C uses a compiler.
  • Interpreter – translates and runs the program one line at a time, and stops at the first error it meets. Python normally uses an interpreter.
  • Assembler – translates assembly language into machine code.

Steps in implementing a program

  1. Create the source code – type the program in a high-level language using an editor or IDE (e.g. IDLE, Thonny, VS Code, Code::Blocks). The program you type is called source code.
  2. Translate (compile) – the compiler checks for syntax errors and converts the source code into object code (machine code).
  3. Link – the linker joins the object code with any library code it uses (e.g. the code for printf) to make one executable file.
  4. Execute (run) – the computer runs the executable program, and you test it with test data.
  5. Maintain – after the program is in use, it is corrected, updated and improved (e.g. when the VAT rate changes or users ask for a new feature).

For example, to run the C program above in a terminal you type gcc hello.c -o hello (compile and link) and then ./hello (execute).

Try it: Which step or term is it?

Choose the correct answer for each description.

Typing the program in Python or C
Converting the whole program into object code
Joining object code with library code to make an executable file
Running the program with test data
Updating the program a year later to add a new feature
Translates and runs one line at a time
Language made of mnemonics like ADD and MOV

Related

Related: The Real Context of Program Implementation & Programming languages – 2025-10-08_09-30-23

Paper 1 practice (multiple choice)

Choose the best answer for each question. Try them all before you check.

1. Which of the following is a high-level language?
(A) Machine code
(B) Assembly language
(C) Python
(D) Binary

2. A program that translates the whole of a source program into machine code before it is run is
(A) an interpreter
(B) a compiler
(C) an assembler
(D) a linker

3. Assembly language uses
(A) English sentences
(B) mnemonics such as ADD and MOV
(C) only 0s and 1s
(D) pictures

4. Which step joins object code with library routines to make an executable program?
(A) Editing
(B) Linking
(C) Maintaining
(D) Testing

5. ONE advantage of a high-level language over a low-level language is that it is
(A) harder to read
(B) machine-dependent
(C) easier to learn and portable
(D) always faster

Show answers

1. C
2. B
3. B
4. B
5. C

Paper 2 practice (structured question)

A programmer in Georgetown writes a program in C to keep track of a shop’s stock.

(a) Distinguish between a low-level language and a high-level language. (2 marks)

(b) Name TWO types of low-level language. (2 marks)

(c) Describe the following steps in implementing a program:

(i) compiling (1 mark)

(ii) linking (1 mark)

(iii) executing (1 mark)

(d) State ONE difference between a compiler and an interpreter. (2 marks)

(e) Explain why maintenance is a step in implementing a program. (1 mark)

Total: 10 marks

Show answers

(a) A low-level language is close to machine code and machine-dependent (1 mark); a high-level language uses English-like statements and must be translated / is portable (1 mark).

(b) Machine language (1 mark); assembly language (1 mark).

(c)

(i) Translating the whole source code into object/machine code and reporting syntax errors (1 mark)

(ii) Combining the object code with library routines to make an executable file (1 mark)

(iii) Running the executable program so the computer carries out the instructions (1 mark)

(d) A compiler translates the whole program before it is run (1 mark); an interpreter translates and runs it one line at a time (1 mark).

(e) Programs need to be corrected and updated over time as errors are found or requirements change (1 mark).

Previous: Testing Algorithms with Trace Tables (Desk Checks and Dry Runs)
Next: Program Errors, Testing and Debugging: Syntax, Logic and Runtime Errors
Back to CSEC Information Technology Notes

Syllabus link: This post is relevant to the CSEC® Information Technology Syllabus (CXC 30/G/SYLL 17), Section 8: Program Implementation, Specific Objectives 1 and 2 (“distinguish between low-level and high-level programming languages” and “describe the sequence of steps in implementing a program”).

Attributions to media used in this post:

Updates

2026/11/23

– Added Previous, Next and Back to course links at the end of the lesson.

2026/10/16

– Syntax highlighting added to code examples.

© 2026 Vedesh Kungebeharry. All rights reserved.

Decimal to binary

Task: Create an algorithm which accepts a decimal integer and outputs it’s binary equivalent.

This algorithm was designed and implemented in Flowgorithm:

See the video below for an explanation of how the algorithm works:

Decimal to binary algorithm explained

The code in C is shown below:



Copy and paste from here:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>//library needed for string operations

int main()
{
    //declare and identify integers
    int number, remainder;

    //declare, identify and initialize all strings
    char  result[20]="";
    char  remainderString[20]="";


    //initialize all other variables
    number=-1;
    remainder=-1;

    //get input
    printf("Enter a number in decimal\n");
    scanf("%d", &number);
    printf("\n");

    while (number!=0)
    {
        remainder=number%2;

            /* #Implementation_Result

                Here we implement the following:

                    result=remainder + result
            */

            //first convert the remainder to a string,
            //and store the converted data in "remainderString"
            itoa(remainder,remainderString,10);

            //add "remainderString" to "result" in that order.
            //the result of the concatenation is stored in "remainderString"
            strcat(remainderString,result);

            //now copy our data so far back to "result"
            strcpy(result,remainderString);
            /*End #Implementation_Result*/


        number=number/2;

    }

    printf("The binary Result is %s \n",result);
    return 0;
}

© 2019  Vedesh Kungebeharry. All rights reserved. 

Implementing Incomplete functions – Programming practise (Part 3)

Download this file: ProgrammingPractise 3 – Commissions and Rewards.fprg

Be sure to read the comments at the start of each function to get an idea of what needs to be implemented. I’ll be happy to answer any questions that you have in class.

See this post if for some detail on how to use the above file: https://islandclass.org/2019/05/16/implementing-incomplete-functions-programming-practise/

© 2019  Vedesh Kungebeharry. All rights reserved.