Skip to content

Computer Programming I – SS2 Digital Technologies Lesson Note (Second Term)

Download this term · ₦1,000

Lesson note at a glance

Subject
Digital Technologies
Class
SS2
Term
Second Term
Topic
Computer Programming I
Order
Topic 1 of 8 this term
Reading time
4 min

A computer program is a set of clear, step-by-step instructions that tell a computer exactly what to do. Before writing a program in a language such as Python or Java, programmers plan it with algorithms, which are written lists of steps, and flowcharts, which are diagrams of those steps. Logic gates combine ON and OFF signals.

Advertisement

Behavioural objectives

By the end of the lesson, students should be able to:

  • define a program and an algorithm;
  • state the characteristics of a good algorithm;
  • name the standard flowchart symbols and state what each one is used for;
  • draw a simple flowchart from an algorithm;
  • explain the AND, OR and NOT logic gates.

What is a program?

Computers cannot think for themselves. If you tell a computer to “make a sandwich”, it will not know where to start.

A program is a set of very clear, step-by-step instructions that tell a computer exactly what to do. Before we write those instructions in a language like Python or Java, we must first plan them using algorithms and flowcharts.

What is an algorithm?

An algorithm is a step-by-step list of instructions written in plain English to solve a problem.

Think of it as a recipe: if you miss a step in a cake recipe (like forgetting the eggs), the cake fails. If you miss a step in an algorithm, the program may fail or give a wrong result.

Example: algorithm to cross a busy road

  1. Walk to the edge of the pavement.
  2. Look to the left.
  3. Look to the right.
  4. If a car is coming, wait and go back to Step 2.
  5. If no car is coming, walk across the road.

Characteristics of a good algorithm

  • Precision: Every step is clear.
  • Uniqueness: There is no confusion about what to do next.
  • Finiteness: It must eventually end (it should not go on forever).

What is a flowchart?

Sometimes a list of words is hard to follow. A flowchart is a diagram that uses different shapes to show the “flow” of an algorithm. It is a visual way to see how a program makes decisions.

The standard symbols

Flowchart shapes follow a standard. Each shape has a specific meaning:

Advertisement
Shape Name Purpose
Oval Start/End Where the program begins and finishes.
Parallelogram Input/Output Used when you ask the user for data (input) or show a result (output).
Rectangle Process Used for “doing” things (calculations, moving data).
Diamond Decision Used for “Yes/No” or “True/False” questions.
Arrows Flow lines They show which way the logic is moving.

How do you draw a simple flowchart?

Take the “Crossing the Road” algorithm and turn it into a flowchart.

  • Start with an oval (Start).
  • Use a rectangle for “Look for cars.”
  • Use a diamond to ask: “Is a car coming?”
    1. If YES, the arrow loops back up to “Wait.”
    2. If NO, the arrow goes down to “Cross road.”
  • End with an oval (Finish).

What are logic gates?

At the most basic level, computers work with “ON” and “OFF” signals (1 and 0). We use logic gates to combine these signals.

  • AND gate: Both signals must be “ON” for the result to be “ON” (for example, you can only enter the lab if you have a key AND the teacher is present).
  • OR gate: At least one signal must be “ON” for the result to be “ON” (for example, you can pass the exam if you score high in the Test OR high in the Exam).
  • NOT gate: It flips the signal. If you put in “ON”, you get “OFF”.

Algorithm, flowchart and pseudocode compared

Tool Format Best for…
Algorithm Written list Planning the steps in plain English.
Flowchart Visual diagram Seeing the “big picture” and the decisions.
Pseudocode Half code, half English The final step before typing real code.
Advertisement

Class practical activity

  1. Group work: On a piece of paper, write an algorithm for “Withdrawing money from an ATM.” (Do not forget the PIN check.)
  2. Individual task: Draw a flowchart that asks a user for their age. If they are 18 or older, display “You can Vote.” If they are younger, display “Too Young.”

Evaluation

  1. What is a program?
  2. State the three characteristics of a good algorithm.
  3. Name the flowchart shape used for a decision and say what it is used for.
  4. Explain the difference between an AND gate and an OR gate, with one example of each.

Assignment

Draw a flowchart that combines two “Decision” diamonds. Use the correct symbols for Start/End, Input/Output, Process and Decision, and label the YES and NO arrows.

This term's Digital Technologies topics

SS2 Second Term · 8 topics

  1. Computer Programming I
  2. Computer Programming II
  3. Programming Basics
  4. Control Structure
  5. Data Science Basics
  6. Big Data and Analytics
  7. Artificial Intelligence
  8. Machine Learning Basics
Downloads

Get Digital Technologies as PDF and Word

Every week of SS2 Digital Technologies, Second Term, formatted and ready to print. Ad-free, and the copy lock comes off.

Get this term Card, bank transfer, USSD or OPay

Advertisement

Lesson Notes for Other Classes

Print it or edit it in Word

Every note is free to read online. A PDF or Word copy of one subject costs ₦1,000 for one term, or ₦2,000 for all three terms.

Continue with GoogleContinue with Facebook

Sign in first, then choose your class and subject at checkout.