Skip to main content

COMPUTER PROGRAM, LANGUAGE, AND PROGRAMMING

Program, Computer Language & Programming Language

Program, Computer Language & Programming Language — Student Guide

Clear definitions, types, examples, how programs work, flowcharts, pseudocode and practice questions with answers.

What is a Program?

A program is a sequence of instructions written to perform a specific task on a computer. Think of it as a recipe: it lists steps (instructions) the computer follows to produce a result (like baking a cake).

Example: A calculator app is a program that performs arithmetic when you press buttons.

Key parts of a program

  • Instructions/Statements: The individual steps the computer executes (e.g., read input, add numbers, display output).
  • Variables: Storage containers in the program (names that hold values, like score or age).
  • Data types: Define what kind of data a variable can hold (e.g., integer, text, decimal).
  • Control structures: Decide the flow (if-then, loops like for/while).
  • Comments: Notes inside the code to explain what parts do (ignored by the computer).

What is a Computer Language?

A computer language is a way of writing instructions so computers can understand them. There are many computer languages — some are machine-friendly, others are human-friendly.

Two extreme examples: Machine code (010101...) which is hard for humans, and high-level languages (like Python) which are easy for humans.

Levels of computer languages

  1. Low-level languages — close to the computer’s hardware. Examples: Machine code (binary) and Assembly language (short readable codes). They are fast but hard to write.
  2. High-level languages — closer to human language and easier to write and read. Examples: Python, Java, C, BASIC.

What is a Programming Language?

A programming language is a formal language that humans use to write programs. It has rules (syntax) and commands that a computer can understand after translation.

Compiled vs Interpreted languages

When we write programs, the computer needs to translate them into machine instructions. This happens in two main ways:

  • Compiled languages: A compiler translates the entire program into machine code before running. Example: C, C++. This often makes the program run faster.
  • Interpreted languages: An interpreter translates and runs the program line-by-line as it executes. Example: Python, JavaScript. This makes testing and debugging faster for learners.

Examples of popular programming languages

LanguageTypeCommon use
PythonHigh-level, interpretedBeginner-friendly, web & data science
JavaHigh-level, compiled (to bytecode)Mobile apps, large systems
CHigh-level / low-level features, compiledSystems programming, hardware interfaces
AssemblyLow-levelHardware control, very fast code

How a Program Gets From Idea → Working Software

  1. Problem/Task: Decide what the program must do (e.g., add two numbers).
  2. Algorithm: Write the steps to solve the problem in plain language or flowchart.
  3. Pseudocode / Flowchart: Use simple steps or diagrams to plan the program (not real code yet).
  4. Write source code: Use a programming language to write the instructions (the source code).
  5. Translate & run: Use a compiler or interpreter to translate and run the program.
  6. Test & Debug: Fix errors (bugs) until the program works correctly.

Flowchart — quick example (add two numbers)

Flowcharts use shapes to show steps. Simple flow for adding two numbers:

  1. Start → Read number A and number B → Compute SUM = A + B → Display SUM → End

Pseudocode — same example

BEGIN
  READ A
  READ B
  SUM = A + B
  PRINT SUM
END
        

Simple Example Program (in easy pseudocode and Python)

Pseudocode

BEGIN
  PRINT "Enter first number:"
  READ A
  PRINT "Enter second number:"
  READ B
  SUM = A + B
  PRINT "The sum is", SUM
END
        

Python code (same idea)

# Simple program to add two numbers
a = int(input("Enter first number: "))
b = int(input("Enter second number: "))
sum = a + b
print("The sum is", sum)
        

This Python program is easy to run in any Python interpreter or online coding site. It is a good starting example for SS1 students.

Common Terms Students Should Know

  • Source code: The human-readable program written in a programming language.
  • Compiler: A program that converts source code into machine code (executable).
  • Interpreter: A program that runs source code line-by-line.
  • IDE (Integrated Development Environment): Software that helps write, test and debug code (e.g., Visual Studio Code, Thonny).
  • Bug: A mistake or error in a program.
  • Debugging: Finding and fixing bugs.

Why Learning Programming Languages Matters

  • It teaches problem-solving and logical thinking.
  • Programs automate tasks and make computers useful.
  • Many careers (software, data, engineering) use programming skills.

Practice Questions (click to reveal answers)

Q1: Define a program in simple words.
Answer: A program is a set of instructions written to perform a specific task on a computer, like a recipe for the computer to follow.
Q2: Give two differences between high-level and low-level languages.
Answer: High-level languages are easier for humans to read and write and use English-like words (e.g., Python). Low-level languages are closer to machine hardware (e.g., Assembly) and are harder to write but faster to run.
Q3: What is the role of a compiler?
Answer: A compiler translates the entire source code into machine code (an executable) before the program runs.
Q4: Write the flowchart steps in words for a program that calculates the average of three numbers.
Answer: Start → Read A, B, C → SUM = A + B + C → AVG = SUM / 3 → Display AVG → End.
Q5: Convert the pseudocode below into a single sentence description:
READ marks; IF marks >= 50 THEN PRINT "Pass" ELSE PRINT "Fail"
Answer: The program reads a student's marks and prints "Pass" if marks are 50 or more; otherwise it prints "Fail".

Teaching Tips & Classroom Activities

  • Start with flowcharts and pseudocode before showing real code — this builds thinking before syntax.
  • Use simple programs (add two numbers, grade calculator) for practice.
  • Pair students: one writes pseudocode while the other writes the equivalent Python or BASIC program.
  • Encourage commenting code — it makes debugging easier and shows understanding.

Tip: Use free online IDEs (like Repl.it or Trinket) to run small code examples without installing software.

Prepared for students — clear and classroom-ready. Use this as a blog post, lesson note or printable handout.

Comments

Popular posts from this blog

The Internet JSS2

PROGRAMMING IN BASIC II - Built-in Functions

FILE SHARING -JS2