fbpx

Introduction to Lesson Note – SSS 2 Third Term Computer Studies Week 1

I wrote this Lesson Note – SSS 2 Third Term Computer Studies Week 1; based on the latest national curriculum in Computer Studies for Senior Secondary Schools in Nigeria. At the same time, this note follows the major SSCE syllabuses including WAEC and NECO syllabi. There is no point saying that these curricula/syllabuses are in many wise similar to those for international examinations like IGCSE and the IB.

In fact, this note is international content domesticated for Nigerian students. As such, teachers of students in Nigeria and elsewhere may equally find this helpful.

Particularly, I took into account the major problems and weaknesses of SSCE candidates during Computer Studies final year examinations. And I implemented the lesson-level official recommendations of the WAEC /NECO Computer Studies Chief Examiner. In addition, I presented the lesson in such a way that it covers recent questions on the topic in recent SSCE/IGSCE examinations (2015 – 2023).

Consequently, if a teacher delivers the lesson using this lesson note; they will equip the students with both state-of-the-art computer skills and knowledge as well for the final year examinations.

To Who Will Teach Using This Lesson Note – SSS 1 First Term Computer Studies Week 1

Computer Teachers in this modern time must understand that they possess a job whose description is more than that of other subject teachers. The possession of Computer skills is not simply a matter of academic prowess, but a necessary life skill. To the students, it is worth as good as the difference between success and failure.

The true measure of how well you have done your job is not only about your student’s performance in Computer examinations. But are the students truly able to use computers as they should, with the necessary ease? Can they perform level-appropriate tasks? Do they demonstrate the right attitude towards the use of computers and related devices?

If you teach Computers to older students (15+), you will soon find out that your job; in addition to others, is to reorient them on the proper use of computing devices. If you teach computers in a less advantaged area, where availability is still an issue; your job will include going out of your way to acquiring one or two to give them the experience.

You will realize the difficulty of getting (refocusing) the “experienced” to do the needed. You will battle with the apprehension.

But when against all odds, you do your job successfully, when you equip your students with not only the knowledge to excel in Computer examinations; but are also able to perform their level-appropriate tasks efficiently with the right attitude; then you will have earned the natural right to the Law of Compensation.

This is not a regular Lesson Plan, nor Lesson Note to be submitted

Before we go into the note proper, let me point out that this Lesson Note – SSS 2 Third Term Computer Studies Week 1 is not a regular lesson plan. Although this guide contains most of the components of a standard lesson plan, it is too comprehensive for a regular lesson plan which you can submit.

Hence, I do not expect you to download and submit everything here. However, you can form your lesson plan from this guide. In fact, that is the secondary goal – to make lesson planning easier for you.

To formulate your lesson plan from this lesson note, click here to download our Standard Lesson Plan Template for just N300 only on Paystack.


Lesson Note – SSS 2 Third Term Computer Studies Week 1

Topic: Algorithms and Flowcharts

Class: SSS 2 (15 – 17 years)

Objectives:

At the end of the lesson, the students should be able:

  • List the stages in System/Program Development Life Cycle (SDLC/PDLC).
  • Define algorithm.
  • Mention and differentiate between at least 3 ways of expressing an algorithm.
  • Define key terms expressing programming concepts.

Entry Requirements

This lesson assumes that the students understand the concept of problems and the meaning of computer programs and programming.

Presentation

Step 1: Introduction

Set Induction

  1. Divide the students into groups of 3-4.
  2. One student in each group is designated as the “commander“, another group member is the “soldier” and the remaining are the observers.
  3. Create a walking path across the classroom or study space. Block some points along the path with desks so that anyone walking will have to change directions to complete the journey. At other points, block the path with smaller objects that will require anyone walking along the path can cross.
  4. Explain to the students that the goal of each group is for the “commander” to verbally direct the “soldier” to walk around the path once – from and to the starting point. Give them the rule of the game:
    • Once the soldier has started to walk at the first instruction of the commander, the commander cannot correct any subsequent instructions s/he will issue.
    • The soldier must follow the instruction of the commander to the letter. Practically, the soldier is a robot – s/he cannot think or take decisions on his/her own. Everything the soldier does once the game has started must be what the commander said.
    • The commander cannot physically touch or guide the soldier in any way.
    • Once the game begins, nobody is allowed to talk until the soldier completes the journey.
    • If due to the unclear or wrong command, the soldier gets stuck or steps on an obstacle along the path, the goal is over. Then another group will try.
    • The role of the observers is to write down every instruction that the commander will issue.
    • Each commander initiates and ends a journey with the words “start/begin” and “stop/end” respectively.
  5. After each round, the groups can switch roles so that every student has a chance to be the “commander.”

Preserve the instructions that the observers wrote down in which the soldiers successfully completed the journey.

At the end of the exercise, ask the students if they can answer any one of the following questions:

WAEC Algorithm and Flowchart Questions
  1. (WAEC, 2019) Explain the following stages of the System Development Life Cycle
    • Feasibility Study
    • Design
A flowchart, an extract from 2019 WAEC Question Paper
A flowchart, an extract from the 2019 WAEC Question Paper
  1. WAEC 2019:
    • Identify Figure 1.
    • Name the parts labelled I, J, K and L in Figure 1.
    • Define the documentation stage in Program Development Life Cycle.
Cambridge IGCSE Algorithm and Flowchart Questions
  1. Four programming concepts and four descriptions are shown. Draw one line to connect each programming concept to the most appropriate description.
Extract of Cambridge IGCSE™ Computer Science Specimen Paper 2 for 2023 Examinations
Extract of Cambridge IGCSE™ Computer Science Specimen Paper 2 for 2023 Examinations
  1. An algorithm has been written in pseudocode to input some numbers. It only outputs any numbers that are greater than or equal to 100. The number 999 is not output and stops the algorithm.
INPUT Number 
 WHILE Numbers <> 999 DO 
  IF Number > 100 
     THEN 
         OUTPUT Number 
  ENDIF 
 ENDWHILE 
OUTPUT Number 

a. Identify the four errors in the pseudocode and suggest a correction.

International Baccalaureate (IB) Examination Algorithm and Flowchart Questions
Lesson Note – SSS 2 Third Term Computer Studies Week 1 - International Baccalaureate (IB) Examination Algorithm and Flowchart Questions
International Baccalaureate (IB) Examination Algorithm and Flowchart Questions
  1. (IB 2019) With reference to the algorithm in the flow chart, construct this algorithm in pseudocode so that it performs the same function.

Conclusion of Introduction

There is a high tendency that the majority of the students will be unable to answer any of the questions correctly.

Hence, reveal to the students that the question you gave was an extract of the final examinations they will write. And they shall in the week’s lesson, discuss a crucial and highly profitable aspect of computer science – systematic problem-solving skills.

Add more relevance to the topic by explaining to the students that according to Search Engine Journal, the highest in-demand hard skill in 2023 is software development. Buttress this with a successful software development story the students can relate to. I recommend the story of Paystack founders for Nigerian schools:

Shola Akinlade and Ezra Olubi are software developers. They met at Babcock University. In 2015, the developed software – an online payment platform. Just 5 years later, in 2020, a company acquire their software for 200 million dollars or about 100 billion nairas.

Finalize that one of the central skills in software development is the ability to find systematic solutions to problems. Remind them that they shall learn this skill and prepare themselves for this aspect of their final year examination starting from the week’s lesson.

Thereafter, project/write the topic on the board/screen; list out and explain the lesson objectives.

Step 2: Program (System) Development Life Cycle

To continue the lesson, ask the students what they think are the steps that software developers or programmers take in creating new software.

At the end of the discussion, explain that in computers, most projects (problem-solving exercises) are in cycles. When we say something is in a circle, we mean that it has a defined path that it follows from start to finish repeatedly. This enables professionals to easily replicate solutions, learn from previous experiences, and improve upon subsequent ones.

The same is true for software development. Software developers have standard (well-defined) paths they follow to develop and improve the software. This is what we call System Development Life Cycle (SLDC). While the system development life cycle is generic, the program development life cycle applies specifically to software development.

Following this, identify the stages or phases of the program development life cycle as follows:

  1. Analysis & Feasibility Study
  2. Design
  3. Programming or Coding
  4. Implementation or testing
  5. Maintenance

Briefly explain each of these phases and highlight key terms and concepts as follows.

Analysis

The analysis is the first stage of SDLC in which needs are assessed and business questions are translated into engineering problems by considering factors such as cost (how much will this cost?), performance, functionalities (what features will this have?) and risks (what are the dangers involved in this?).  

In this phase, all the people involved in the project (stakeholders including developers, users and owners) will write out the needs in clear terms so anyone working on the solution will understand what is needed.

The clearly documented needs (what is expected) of the software are called requirements specifications of the program.

A real-life requirement specification is a comprehensive document. It is usually arranged under different headings starting from introduction, purpose, scope, functional and non-functional requirements, etc.

Below are examples of different software requirements specifications. Make copies and distribute them to students for perusal.

1       Introduction

1.1 Purpose The purpose of this software requirement specification (SRS) is to define the requirements for a simple alarm app.

1.2 Scope The alarm app is designed to provide a basic alarm and reminder service to users. The app will allow users to set a single alarm with a customizable time and sound.

2       Functional Requirements

2.1 Alarm Functionality

The alarm app shall allow users to set a single alarm with the following customizable settings:

  • Alarm time
  • Alarm sound
  • Snooze time
  • Label for alarm
  • Volume

2.2 Notification Functionality

The alarm app shall provide a notification for the alarm, including the following information:

  • Label for alarm
  • Time for alarm

2.3 User Interface Requirements

The alarm app shall have a user-friendly interface that allows for easy creation, editing, and deletion of the alarm.

2.4 Compatibility Requirements

The alarm app shall be compatible with the following devices and operating systems:

  • iOS devices running iOS 14 or later
  • Android devices running Android 9.0 or later
3       Non-Functional Requirements

3.1 Performance Requirements The alarm app shall provide real-time notification for the alarm with a latency of less than 1 second.

3.2 Reliability Requirements The alarm app shall have a mean time between failures (MTBF) of at least 100 hours.

3.3 Usability Requirements The alarm app shall have a user-friendly interface that allows for easy creation, editing, and deletion of the alarm.

3.4 Security Requirements The alarm app shall have secure login and access controls to prevent unauthorized access.

4       Constraints

4.1 Hardware Constraints The alarm app shall require minimal processing power and memory and shall be compatible with a range of mobile devices.

4.2 Environmental Constraints The alarm app shall be able to operate in indoor and outdoor environments.

5       Assumptions and Dependencies

5.1 Assumptions The alarm app assumes that the user’s mobile device is in good working condition and that the user has a reliable internet connection.

5.2 Dependencies The alarm app depends on the correct installation and configuration of the mobile device and operating system.

1.      Introduction

1.1 Purpose

The purpose of this software requirement specification (SRS) is to define the requirements for an app that directs a robot to can walk across a classroom.

1.2 Scope

The robot is designed to walk across a classroom and be controlled by a simple program. The robot will have basic walking, turning, and obstacle-avoiding capabilities.

2.      Functional Requirements

2.1 Movement Functionality

The robot shall be able to move forward and turn left or right. The robot shall be able to turn by rotating one of its legs while the other leg remains stationary.

2.2 Programming Interface

The robot shall be programmed using a simple interface that allows for the following actions:

  • Move the robot forward a specified distance
  • Turn the robot left or right
  • Stop the robot

2.3 User Interface Requirements

The programming interface shall have a user-friendly interface that allows for easy programming of the robot.

2.4 Compatibility Requirements

The robot shall be compatible with a range of programming languages, including Scratch and Python.

3.      Non-Functional Requirements

3.1 Performance Requirements

The robot shall be able to walk across a classroom without falling over, avoid obstacles in the classroom, and stop when it encounters an unavoidable obstacle.

3.2 Usability Requirements

The programming interface shall be simple and easy to use.

4.      Constraints

4.1 Hardware Constraints

The robot shall have a basic walking and turning mechanism that is powered by a simple motor.

4.2 Environmental Constraints

The robot shall be able to operate on a classroom floor.

5.      Assumptions and Dependencies

5.1 Assumptions

The robot assumes that it will be used in a classroom environment with a suitable floor surface.

5.2 Dependencies

The robot depends on the correct installation and configuration of the programming interface.

There are two tools in the analysis phase to ensure that requirements specification is truly specific. These are abstraction and decomposition.

Abstraction

Abstraction is the process of removing unnecessary details from a problem or solution. For example, below are the abstracted version of the requirements specifications. We may:

  • abstract a problem – this is called problem abstraction.
  • Lengthy or multiple procedures – this is called procedural abstraction.
  • Bulky solution – this is called solution abstraction.
  • Overwhelming (too much) data – this is called data abstraction.
  • Too many functions or features – this is called functional abstraction.
Benefits of Abstraction

The benefits of abstraction include:

  • Reduced development time because factors that can detract from the program can be ignored.
  • It makes the program more likely to solve the problem because unnecessary aspects will not detract from the main purpose of the program.
  • Reduces complexity of programming code because therefore can run on lower spec computers.
How to Abstract a Requirements Specification

To abstract a requirements specification, write out only what the system will do. You may also summarize the performance and functional requirements, each in one or two sentences.

Example 1: Abstracted Requirements Specification for Robot App

The Classroom Robot application will direct a robot to walk across a classroom. It will avoid obstacles in the classroom and stop the robot if it encounters an unavoidable obstacle. The Classroom Robot application must be able to direct the robot to walk across the classroom in a timely manner and stop if it encounters an unavoidable obstacle.

Example 2: Abstracted Requirements Specification for Alarm App

The app shall allow users to set a single alarm with customizable settings, including alarm time, sound, snooze time, label, and volume. The notification for the alarm shall include the label and time for the alarm.

Decomposition

Decomposition is the process of breaking down a problem or solution into smaller, more manageable parts.

Any problem that uses a computer system for its solution needs to be decomposed into its component parts.

The benefit of decomposition is that it makes complex problems easier to solve and manage.

Computer System

A computer system is any system that is made up of software, data, hardware, communications and a person(s). There are different sizes of computer systems – from very large to very small ones. Examples of a simple computer systems are mp3 players and alarm apps. There are also complex computer systems like a smartphone.

Creating or maintaining a computer system for business problems (i.e., automation) is a problem that requires a systematic approach.

For complex computer systems, the first step is to divide them into smaller parts. The small parts which combine to form a complex system are called sub-systems.

Sometimes, a system may be so large or complex that we have to break it down into multiple downlines of sub-systems. That is, we break the initial complex system into the major sub-systems. Then, we break the major sub-systems into a set of further sub-systems until each sub-system is simple enough to perform only one task.

How to Decompose a Problem or System

The process of breaking a complex system down into smaller sub-systems is called stepwise refinement or top-down design.

This is one of the standard approaches that developers employ in solving any problem. They do this by breaking down abstracted requirements specifications into the component parts of a computer system.

The component parts of any computer system are:

inputs – the data used by the system that needs to be entered while the system is active

processes – the tasks that need to be performed using the input data and any other previously stored data

outputs – information that needs to be displayed or printed for the users of the system

storage – data that needs to be stored in files on an appropriate medium for use in the future.

To decompose a problem is to identify the inputs, the processes, the outputs and the storage.

Benefits of Decomposition

This is the aim of decomposing a problem is to make the problem easier to solve. Decomposing a system also makes the system easier to manage and maintain.

Example: Decomposed Alarm App
  • inputs – time to set the alarm, remove a previously set alarm time, switch an alarm off, and press the snooze button.
  •  processes – continuously checking if the current time matches an alarm time that has been set, storing and removing alarm times, and management of snooze.
  • outputs – continuous sound/tune (at alarm time or after snooze time expired).
  •  storage – time(s) for alarms set.
Composition

Composition is the process of combining sub-systems into compound or complex systems. Initially, you decompose to make solving the problem easier. After solving the problem, you may need to recombine the different parts to form a complete solution for the complex problem you initially set out to solve.

Subroutines, Functions, Procedures & Sub-programs

After decomposing a problem or system into sub-systems that perform one task, the instructions or program for each of such tasks may not be the complete software on their own. Instead, each is a part of the entire software that performs one particular task of the sub-system.

This kind of instruction is called routine or sub-routines. Thus, we can define routines or subroutines as a sequence of program instructions that perform a specific task, packaged as a unit.

This unit can be used in programs wherever that particular task needs to be performed.

Types of routines or subroutines

There are different terms that identify subroutines based on how developers use them. These include:

  • Library routine – A standard subroutine that is available for immediate use.
  • Procedure – A subroutine that may not return a value. It only controls the flow.
  • Function – A subroutine that can be used assigned, reassigned, called and recalled many times in a program with a different set of data.

Stage Evaluate Question

Before you proceed to the next step of the lesson, assess the students’ understanding of the contents you have covered so far. To do this, give them the exercises below:

Short Quiz
  1. What is the full meaning of SLDC?
    1. Software Logic Development Component
    1. System Life Development Cycle
    1. Software Logic Development Cycle
    1. System Life Development Component
  2. What is the first stage of the Program Development Life Cycle?
    1. Design
    1. Analysis & Feasibility Study
    1. Programming or Coding
    1. Implementation or testing
  3. What are some factors considered during the Analysis phase of the Program Development Life Cycle?
    1. Cost, performance, functionalities and risks
    1. Design, implementation, testing and maintenance
    1. Programming or coding, testing, maintenance and analysis
    1. Feasibility study, design, programming or coding and implementation
  4. What is the main difference between PDLC and SDLC?
    1. PDLC is a subset of SDLC and applies specifically to software development while SDLC focuses on creating high-quality software in general.PDLC focuses on creating high-quality software in general while SDLC applies specifically to software development.PDLC and SDLC are the same things.
    1. None of the options is correct.
  5. What is a requirements specification?
    1. Defining the requirements of a system such as software or hardware components.Designing the user interface of a system.Writing code for a system.
    1. Requesting initial payment for commencement of a project.
  6. What is the purpose of requirement specification?
    1. Assessing needs and translating business questions into engineering problems.
    1. Designing software solutions based on user needs.
    1. Write codes for software solutions.
    1. Testing software solutions for bugs and errors.
  7. What is the process of breaking down a complex problem or system into smaller parts that are more manageable and easier to understand?
    1. Abstraction
    1. Decomposition
    1. Pattern recognition
    1. Algorithm
  8. What is the process of focusing on the important information only, ignoring irrelevant detail?
    1. Abstraction
    1. Decomposition
    1. Pattern recognition
    1. Algorithm
  9. What is the process of developing a computer program by first describing general functions, then breaking each function down into details which are refined in successive steps until the whole program is fully defined?
    1. Abstraction
    1. Decomposition
    1. Stepwise refinement
    1. Flowchart
  10. What is the key idea in stepwise refinement?
    1. You should start the design of your program from the bottom.
    1. You should start the design of your program from the middle.
    1. You should start the design of your program from the top.
    1. None of the above.
  11. Find at least five computer systems you frequently use in your daily life.
  12. Decompose one of the computer systems into sub-systems and/or component parts of inputs, processes, outputs and storage.
  13. Table 1 lists some terms that are important in the theory of computation. These terms are described in Table 2. Complete Table 2 by filling in the unshaded cells with the appropriate labels (A) to (H) from Table 1. On each row write the label that most closely matches the description.
Extract of Cambridge AS Computer Science Examination Paper 1 of June 4 2018
Extract of Cambridge AS Computer Science Examination Paper 1 of June 4 2018
  1. Four programming concepts and four descriptions are shown. Draw one line to connect each programming concept to the most appropriate description.
Extract of Cambridge IGCSE™ Computer Science Specimen Paper 2 for 2023 Examinations
Extract of Cambridge IGCSE™ Computer Science Specimen Paper 2 for 2023 Examinations
  1. Sally is a classroom teacher. She would like a program to be able to organise where students will sit in her classroom. A plan of her classroom is shown in Fig. 1.
Extract of Oxford Cambridge & RSA AS Level Computer Examination - Paper H046-02 - Algorithms and problem solving
Extract of Oxford Cambridge & RSA AS Level Computer Examination – Paper H046-02 – Algorithms and problem-solving
  • State three ways that Sally has made use of abstraction in Fig. 1.
  • Explain two benefits to Sally of using abstraction before creating the programming code

Step 3: Definition of Algorithm and Identification of Algorithm Representation Tools

To continue the lesson, recap what you have discussed so far:

  1. You are discussing/teaching the students a crucial and one of the most profitable skills in Computer Science. That is, tools for problem-solving which is a part and parcel of software development.
  2. You are also preparing the students for their final year examinations. They will learn to be able to answer a key (almost compulsory) component of their syllabus/examinations. Remind them that they have answered some of the earlier challenges. But they have others left.
  3. Remind them of the lesson objectives.
  4. Tell them that in pursuit of the objectives, you began the last class by identifying the steps developers take to create new software. Ask the students to identify these steps.
  5. Remind them that you have taught them what developers do in the first phase, the analysis phase. You also discussed the product of that exercise (requirements specification).
  6. Tell them that the model for translating a business problem in requirement specification into a computer system is called automation.
  7. Remind them that requirements specifications are usually bulky documents. As such, developers devised tools or processes to simplify them and make them truly specific and easier to solve. Request the students to name these tools or processes (Abstraction, Decomposition, and Composition).
  8. Ask the students questions to revise the meaning, benefits and procedure for abstraction and decomposition.
  9. Finalize the revision by telling the students that once developers have decomposed the requirements specification and everybody has a clear picture of the needs, they proceed to the next phase of PDLC – the Design Phase.

The Design Phase

Ask the students what they think is the design phase in PDLC and the activities they think developers perform in this phase towards achieving the final product.

After discussion, explain the design phase as follows.

The design phase of PDLC is the phase in which developers list out all tasks that software needs to perform, the steps that are involved in each task, and how the tasks will work together.

Although decomposing a system at the analysis phase will reduce the system to sub-systems that focus on a specific task, considering the sub-systems further may reveal more underlying tasks. This is where the developer begins the design phase.

After identifying all the tasks, developers consider the steps involved in each task and how the different tasks will work together (i.e., composition).

Example: Decomposition of the Alarm App (Group Work)

Group the students into groups of 3-5. Then, present each group with the decomposed alarm app we discussed earlier:

  • inputs – time to set the alarm, remove a previously set alarm time, switch an alarm off, and press the snooze button.
  •  processes – continuously check if the current time matches an alarm time that has been set, storage and removal alarm times, and management of snooze.
  • outputs – continuous sound/tune (at alarm time or after snooze time expired).
  •  storage – time(s) for alarms set.

Task each group to identify all the tasks in the simple app. These include tasks that the alarm owner and the system will perform in operating the app.

Task List

At the end of the discussion, recall the students. After this, list out the tasks that the various groups identified. Add more where necessary. Below is my preliminary list:

  1. Setting alarm
  2. Storing alarm setting
  3. Removing the previous alarm setting
  4. Checking the current time and matching it with the alarm time
  5. Sounding reminder
  6. Ringing alarm
  7. Snoozing alarm
  8. Turning the Alarm off

Looking at this initial list may seem like all the tasks in the alarm app. This is what we obtained from decomposing the app. But if you consider each task further, you will find out that there are more hidden tasks within each.

For example, setting an alarm involves other tasks like setting the time, setting the reminder time (whether or not to set at all and if yes, time to remind), and setting the ringing tune.

Checking and matching time can be divided into Getting the current time, getting the alarm time, and deciding the state (true or false).

We can also break snoozing alarm into Getting Snooze status (to determine whether on/off and the snooze time (if on)), short ringing, stopping ringing, and resetting snooze (if on).

Ringing the alarm involves checking and matching the current and alarm times, long ringing, and stopping ringing.

Steps in each task

After identifying all the tasks, developers will list out the steps involved in each step. The complete steps or instructions for every task must begin and end with the keywords “start/begin” and “stop/end” respectively.

For instance, below are the steps for ringing the alarm.

  1. Start
  2. Get time current time and alarm time
  3. Is the time current time equal to the alarm time?
    • If yes, ring the alarm for 2 minutes and go to step
    • If no, wait for 30 seconds then go back to step 2
  4. Stop
Modularization: Subroutines

While developers write out the steps for all the tasks, they may notice that some steps are repeated. In programming, it is inefficient to repeat a set of instructions for performing the same or similar tasks.

For example, we have written the instructions for checking time in performing the task of ringing the alarm. But if you look carefully, we also have to check the time in performing the task of ringing reminders. Do we have to repeat the same instruction for the two separate tasks? No!

Instead, the developer will group the set of instructions for checking time and give it a name. Then, wherever it needs to check the time, it will invoke or call the name of the set of instructions to do its work.

This is what we call routines. As we discussed earlier, this kind of routine is called a function.

In writing their instructions for tasks, developers may invoke certain instructions that are already in the system. For instance, in the instructions for checking time above, we made use of “Get time”. Ordinarily, you might want to ask how does a computer get the time? You don’t need to worry about this because there are sets of instructions for standard tasks that computers frequently perform which are either preinstalled on the computer or which we can preinstall and use.

A bundle of these sets of instructions for standard, frequently performed operations is what we call libraries.

Algorithm

An algorithm is a general term for describing a series of unambiguous instructions designed in order to solve a problem and achieve a certain goal in a finite number of steps.

Unambiguous instructions mean that every instruction in an algorithm should have and imply only one meaning. Neither the instruction nor a word in the instruction should be able to be interpreted in more than one way.

A finite number of steps means that the steps in an algorithm should have a limit. It may be two, twenty, hundred or a thousand steps, but there must be a definite end to the steps.

We may call the steps we wrote for checking the time the algorithm for checking time.

Features of a good algorithm

A good algorithm should be:

  1. simple
  2. clear with no ambiguity
  3. a unique solution to the problem
  4. finite in the number of steps to arrive at a solution
  5. able to handle unexpected situations.

Step 4: Ways of Representing Algorithm

In the final part of the lesson, tell the students that there are many ways of representing algorithms – i.e., the set of steps to solve a problem.

The way we wrote the steps for checking time in the previous step using the usual English Language, is only one way of doing so. This is called natural language.

Computers are like robots. As we see in the set induction, normal computer programs cannot think or take decisions on their own. They are as efficient as how clearly you write your instructions. This is why developers ensure that they write instructions in a very simple and unambiguous way.

Usually, natural language is not unambiguous enough. One way may mean different things. As a result, developers have other ways of representing or writing algorithms.

The various ways of representing or writing algorithms are:

  1. Natural Language
  2. Flowchart
  3. Pseudocode
  4. Structure Diagrams

The recommended method for WAEC is flowchart and pseudocode while IGCSE requires flowchart, pseudocode and structured diagrams.

Explain to the students that they shall in the next three weeks learn how to express algorithms in each of the methods. However, they shall learn to identify each of them this week.

Following this, define and thoroughly explain the meaning of each using relevant samples.

Flowcharts

A flowchart is a diagram made of two or more different standard symbols (shapes), lines and arrows which represent an algorithm, the steps required to complete a task and the order that they are to be performed.

Example of flowchart

Below is the flowchart for the alarm ringing algorithm we discussed earlier.

An Example of Flowchart
An Example of a Flowchart

A close look at this flowchart shows that there are different standard symbols (plane shapes) – rounded rectangle, rectangle and diamond or rhombus. In addition, the symbols are connected by arrows. Each of these symbols and the arrows has a unique meaning to developers as long as flowcharting is concerned.

These are not the only symbols like parallelograms, ovals, and circles among others in flowcharting.

The flowchart above says exactly the same thing as we expressed in natural language earlier. However, developers prefer flowcharts over natural language for certain reasons.

Benefits of Flowcharts over

Flowcharts offer several benefits over natural language for representing a process or algorithm, including:

  1. Visual representation: Flowcharts provide a visual representation of the process, which makes it easier to understand the steps involved and the overall flow of the process.
  2. Clear and concise: Flowcharts can convey complex ideas in a clear and concise manner, making them easier to comprehend than long blocks of text.
  3. Standardized notation: Flowchart symbols and notation are standardized, which makes it easier for different people to understand and interpret them.
  4. Error detection: Flowcharts can help identify errors and inconsistencies in a process, making it easier to correct them before they cause problems.
  5. Simplifies complexity: Flowcharts can help simplify complex processes by breaking them down into smaller, more manageable steps.
  6. Improves communication: Flowcharts can improve communication and collaboration among team members, particularly when working on complex projects.

Pseudocode

Pseudocode is a written form of an algorithm using keywords, operators and names for data and routines that are similar to those in a high-level programming language but without following the syntax (rules) of any particular programming language.

Example of Pseudocode

Below is the pseudocode for the alarm ringing algorithm we saw earlier.

START
Time ← Get_current_time()
Alarm_time ← Get_alarm_time()
 IF Current_time = Alarm_time
   THEN
      Ring_for_seconds (120)
   ELSE
      Wait_for_seconds(30)
      Current_time ← Get_time ()
 ENDIF
STOP

A careful look at this pseudocode shows that there are some keywords (in capital letters), and operators ( and =). We also created names for the input (data) that the app needs to store – i.e., the current time and the alarm time set by the user. Finally, we decided to give names to our subroutines like Get_current_time().

Notice the way we named data stores and subroutines with an underscore instead of a space. This is part of standard practice in programming – the students will learn more about this in the next lesson. Also, notice the opening and closing parathesis in front of our subroutines. This is also part of the convention we will discuss in the subsequent lessons.

Suffice it to say that this is what a pseudocode looks like. The students should be able to differentiate between this and a flowchart. A flowchart is a diagram while a pseudocode is a text.

Structure Diagram

A Structure Diagram is a diagram made up of mostly rectangles or squares connected by lines in hierarchical order representing the breakdown of a system into component sub-systems.

Example of Structure Diagram

Below is a sample structure diagram for the entire alarm app.

Sample of Structure Diagram
Sample of Structure Diagram

Looking at this, it is clearly different from the flowchart. While this is made up of only rectangles connected by lines, a flowchart is made up of at least two different shapes connected by arrows.

In addition, the structure diagram is in a hierarchy, unlike the flowchart.

Summary

Prior to evaluation and conclusion, summarize the entire lesson into a concise note that you should write or duplicate for the students to copy into their notes. Following this, revise the entire lesson once more.

Evaluation

Before concluding the lesson, give the students the final assessment on the topic. This should include the entire lesson and previous exercises. Past international examination exercises will be added to this note in subsequent revisions.

Conclusion

Conclude the lesson by marking the returning students’ notes. Remember to give appropriate feedback and support students that require additional assistance.

Link the topic to the next by telling them that they shall learn how to think like a programmer, design programs and create flowcharts and pseudocode for their algorithms.

Leave a comment