Module 3 ยท Storing and Using Information
1. Module Introduction
Welcome to Module 3 โ the final module of the Programming Logic for Web Developers
course. You have come a long way. In Module 1, you learned how to think in steps.
In Module 2, you learned how programs make decisions and repeat tasks.
Now we come to the last piece of the puzzle. Programs must remember things. They
must store information. If a program cannot remember your name, your score, or
your shopping list, it is not useful.
In this module, you will learn how programs store and use information. You will
learn about variables โ boxes that hold information. You will
learn about data types โ the different kinds of information.
You will learn about lists and arrays โ ways to
store many things together. You will learn about functions โ
reusable blocks of steps. And you will learn about input and output
โ how programs receive and send information.
Do not worry if these words sound new. Every word will be explained in very simple
language. Every idea will come with examples from real life, school, home, and
Nigeria.
This is the last module. Take your time. Enjoy it. By the end, you will have all
the logic skills you need to start learning HTML, CSS, and JavaScript.
YOUR LEARNING JOURNEY IN MODULE 3
=================================
[ Start ]
|
V
What are Variables?
|
V
What are Data Types?
|
V
Numbers, Text, and True/False
|
V
What are Lists?
|
V
What are Functions?
|
V
What is Input and Output?
|
V
[ You can now store and use information! ]
Summary of the Introduction
This module teaches you how programs store and use information. You will learn
about variables, data types, lists, functions, and input/output.
2. Learning Objectives
By the end of this module, you will be able to:
- Explain what a variable is in your own words.
- Explain what a data type is and why it matters.
- Describe the three main data types: numbers, text, and true/false.
- Explain what a list or array is.
- Explain what a function is and why functions are useful.
- Explain what input and output mean.
- Write simple pseudocode that stores and uses information.
- Give examples of variables, lists, and functions in real life.
- Draw a simple diagram showing how information flows in a program.
- Feel confident and ready to start learning real programming languages.
Summary of Learning Objectives
You will learn how programs store information (variables, lists) and how they use
it (functions, input/output). You will also learn about data types.
3. Warm-up Story โ Amina's School Bag
Amina is a 13-year-old girl who lives in Kano. One morning, she packed her school
bag for the day.
She put her Maths textbook in one pocket. She put her English textbook in another
pocket. She put her pencil case in the front. She put her lunchbox in the side.
She put her water bottle in the other side.
When she got to school, she knew exactly where everything was. When the teacher
asked for Maths, she opened the Maths pocket. When she wanted lunch, she opened
the lunch side.
Her friend, Fatima, was not so organised. She had thrown everything into one big
bag. When the teacher asked for Maths, she spent five minutes searching. When she
wanted water, she could not find it.
"Amina, how do you always know where everything is?" Fatima asked.
Amina smiled. "Each thing has its own place. I gave each item a name. When I need
something, I just call its name."
Fatima thought about it. "So if I put Maths in a pocket called 'MathsBook', I just
say, 'Open MathsBook', and I find it?"
"Exactly," Amina said. "That is how computers work too. Every piece of information
gets a name. When the program needs it, it calls the name."
Fatima smiled. She had learned something important. Information needs a place and
a name. That is what programming is all about.
AMINA'S SCHOOL BAG
==================
[ MathsBook ] <- a variable holding a Maths book
[ EnglishBook ] <- a variable holding an English book
[ PencilCase ] <- a variable holding pencils
[ LunchBox ] <- a variable holding lunch
[ WaterBottle ] <- a variable holding water
Each item has a name. You call the name to get the item.
Summary of the Warm-up Story
Amina organised her school bag by giving each item a name and a place. Computers
do the same with variables. This story introduces the whole module.
4. Main Lessons
In this section, you will go through 12 short lessons. Each lesson teaches one big
idea. Each lesson ends with a mini summary. Read slowly. Think about the examples.
Ask questions. That is how you learn.
Lesson 1 โ What is a Variable?
Definition
A variable is a named box that stores information in a
program. You give it a name, put something inside, and use it later.
Why it is important
Without variables, programs could not remember anything. They would forget your
name, your score, and your shopping list.
Simple explanation
Think of a labelled jar in a kitchen. One jar says "Sugar". Another says
"Salt". You open the right jar when you need it. A variable is like a labelled
jar.
Real-life example
In a game, the score is stored in a variable called "score". Every time you win
a point, the score increases.
School example
A student's name is stored in a variable called "studentName". The school uses
it to print certificates.
Home example
Your family's monthly budget is stored in a variable called "budget". Every
time you spend, the budget decreases.
Nigerian example
A bank stores your account balance in a variable called "balance". When you
deposit money, the balance increases.
Illustration
VARIABLES ARE LIKE LABELLED JARS
================================
[ Sugar ] <- variable holding sugar
[ Salt ] <- variable holding salt
[ Rice ] <- variable holding rice
In a program:
score = 0
name = "Amina"
balance = 5000
Mini summary
A variable is a named box that stores information. You give it a name, put
something inside, and use it later.
Lesson 2 โ Naming Variables
Definition
Naming a variable means choosing a clear word to identify it.
A good name helps you remember what the variable holds.
Why it is important
If you name a variable badly, you will get confused. Good names make programs
easy to read and understand.
Simple explanation
Think of naming a pet. If you call your dog "Dog", it is confusing. If you call
it "Rex", it is clear. Variables are the same.
Rules for Good Names
- Use clear words: studentName is better than
sn.
- Do not use spaces. Use underscores or capital letters:
student_name or studentName.
- Start with a letter, not a number.
- Do not use words the programming language already uses.
- Keep names short but clear.
Real-life example
A game stores the player's score in a variable called "playerScore", not just
"x".
School example
A school stores each student's name in a variable called "studentName", and
their score in "studentScore".
Home example
Your family stores its shopping list in a variable called "shoppingList".
Nigerian example
A bank stores your balance in a variable called "accountBalance". It stores
your account number in "accountNumber".
Illustration
GOOD NAMES vs BAD NAMES
=======================
Bad: x = 5000 (What is x?)
Good: accountBalance = 5000 (Clear!)
Bad: a = "Amina" (What is a?)
Good: studentName = "Amina" (Clear!)
Mini summary
Good variable names are clear, short, and describe what the variable holds.
Bad names cause confusion.
Lesson 3 โ What is a Data Type?
Definition
A data type tells the program what kind of information is
stored in a variable. The three main types are numbers, text, and true/false.
Why it is important
Different types of information behave differently. You can add numbers. You
cannot add text the same way. Knowing the type helps you use it correctly.
Simple explanation
Think of a kitchen. You have dry foods, wet foods, and frozen foods. Each is
stored differently. Data types are like that for information.
The Three Main Types
- Number โ like 5, 100, or 3.14
- Text โ like "Amina", "Hello", or "Lagos"
- True/False โ either true or false
Real-life example
A person's age is a number. Their name is text. Whether they are married is
true or false.
School example
A student's score is a number. Their name is text. Whether they passed is true
or false.
Home example
The number of eggs in a tray is a number. The shopping list is text. Whether
the milk is finished is true or false.
Nigerian example
Your account balance is a number. Your account name is text. Whether your
account is active is true or false.
Illustration
THREE DATA TYPES
================
Number: age = 13
balance = 5000
price = 250.50
Text: name = "Amina"
city = "Kano"
message = "Hello"
True/False: isRaining = true
isPassed = false
hasPaid = true
Mini summary
A data type tells the program what kind of information is stored. The three
main types are numbers, text, and true/false.
Lesson 4 โ Numbers as Data
Definition
Numbers are a data type used for counting, measuring, and
calculating. Numbers can be whole (like 5) or have decimals (like 3.14).
Why it is important
Numbers are used in almost every program. Scores, prices, ages, and distances
are all numbers.
Simple explanation
Think of a market. Prices, quantities, and change are all numbers. You can add
them, subtract them, and multiply them.
Real-life example
A shopkeeper calculates the total price of goods. That is using numbers.
School example
A teacher calculates the average score of the class. That is using numbers.
Home example
Your mother calculates how much money to spend on food. That is using numbers.
Nigerian example
A POS machine calculates the total price of items and prints a receipt. That is
using numbers.
Illustration
NUMBERS IN ACTION
=================
price = 250
quantity = 3
total = price * quantity
total is now 750.
Numbers can be added, subtracted, multiplied, and divided.
Mini summary
Numbers are used for counting, measuring, and calculating. They can be whole or
have decimals.
Lesson 5 โ Text as Data
Definition
Text is a data type used for words, letters, and sentences.
In programming, text is often called a string.
Why it is important
Names, addresses, and messages are all text. Programs use text to communicate.
Simple explanation
Think of a letter you write. Every word is text. A program uses text the same
way.
Real-life example
Your email address is text. Your name is text. Your messages are text.
School example
A student's name and class are text. The school stores them.
Home example
Your shopping list is text. Each item is a word.
Nigerian example
Your bank account name is text. It is stored in the bank's database.
Illustration
TEXT IN ACTION
==============
name = "Amina Yusuf"
city = "Kano"
message = "Hello, how are you?"
Text is always in quotes: "..."
You can join text: "Hello, " + "Amina" = "Hello, Amina"
Mini summary
Text is used for words, letters, and sentences. In programming, text is often
called a string.
Lesson 6 โ True/False as Data
Definition
True/False is a data type with only two possible values:
true or false. It is used for yes-or-no questions.
Why it is important
Many decisions in programs depend on true or false. For example, "Is the user
logged in?" is either true or false.
Simple explanation
Think of a light switch. It is either ON or OFF. True is like ON. False is like
OFF.
Real-life example
"The door is open" is true or false. "The milk is finished" is true or false.
School example
"The student has paid fees" is true or false. The school uses it to allow
exam registration.
Home example
"The gas cooker is on" is true or false. Your family uses it to be safe.
Nigerian example
"Your BVN is verified" is true or false. The bank uses it before you can open
an account.
Illustration
TRUE / FALSE IN ACTION
======================
isRaining = true
isLoggedIn = false
hasPaidFees = true
If hasPaidFees is true, allow registration.
If hasPaidFees is false, block registration.
Mini summary
True/False is a data type with only two values. It is used for yes-or-no
questions.
Lesson 7 โ What is a List?
Definition
A list (also called an array) is a way to
store many pieces of information in one variable. Each piece is called an
item.
Why it is important
Without lists, you would need a separate variable for every item. Lists keep
things organised.
Simple explanation
Think of a shopping list. It has many items. You do not have a separate paper
for each item. You have one list. Lists in programming work the same way.
Real-life example
A music playlist is a list. It has many songs. A contact list on your phone is
a list.
School example
A class register is a list of student names. A timetable is a list of subjects.
Home example
A shopping list is a list of items to buy. A chore list is a list of tasks.
Nigerian example
A bus manifest is a list of passengers. A bank statement is a list of
transactions.
Illustration
A LIST IS LIKE A SHOPPING LIST
==============================
shoppingList = [ "Rice", "Beans", "Oil", "Salt" ]
Item 1: "Rice"
Item 2: "Beans"
Item 3: "Oil"
Item 4: "Salt"
You can get any item by its position.
Mini summary
A list stores many pieces of information in one variable. Each piece is called
an item.
Lesson 8 โ Using Lists
Definition
Using a list means adding items, removing items, reading
items, and going through each item one by one.
Why it is important
Lists become powerful when you can use them. You can loop through them and do
something for each item.
Simple explanation
Think of a teacher with a class register. She calls each name one by one. That
is going through a list.
Common List Actions
- Add โ put a new item in the list
- Remove โ take an item out of the list
- Read โ get an item by its position
- Loop โ go through each item
- Count โ find how many items are in the list
Real-life example
A music player goes through each song in the playlist and plays it one by one.
School example
A teacher goes through each name on the class register and marks attendance.
Home example
Your mother goes through each item on the shopping list and ticks it off as she
buys it.
Nigerian example
A bus conductor goes through each passenger on the manifest and gives a ticket.
Illustration
USING A LIST
============
shoppingList = [ "Rice", "Beans", "Oil", "Salt" ]
FOR each item in shoppingList
print item
END FOR
Output:
Rice
Beans
Oil
Salt
Mini summary
Using a list means adding, removing, reading, and looping through items. Lists
are powerful when combined with loops.
Lesson 9 โ What is a Function?
Definition
A function is a block of steps that you can use again and
again. You give it a name and call it whenever you need it.
Why it is important
Functions save time. Instead of writing the same steps many times, you write
them once and call them.
Simple explanation
Think of a recipe. Once you know the recipe, you can cook the same dish anytime.
A function is a recipe for a program.
Real-life example
A calculator has a "square root" button. You press it and it does the
calculation. That is a function.
School example
A teacher has a routine for marking attendance. She follows the same steps each
day. That is a function.
Home example
Your mother has a recipe for jollof rice. She uses the same steps each time.
That is a function.
Nigerian example
A POS machine has a "calculate total" function. Every time a customer buys
something, it uses the same function.
Illustration
A FUNCTION IS LIKE A RECIPE
===========================
FUNCTION greet(name)
print "Hello, " + name
END FUNCTION
greet("Amina") -> "Hello, Amina"
greet("Chidi") -> "Hello, Chidi"
Same steps, different inputs.
Mini summary
A function is a block of steps you can use again and again. It saves time and
keeps programs organised.
Lesson 10 โ Input and Output
Definition
Input is information that goes into a program. Output
is information that comes out of a program.
Why it is important
Without input, a program would have nothing to work with. Without output, a
program would have nothing to show.
Simple explanation
Think of a calculator. You type numbers (input). The calculator shows the
answer (output).
Real-life example
A bank web application: You enter your account number (input). It shows your
balance (output).
School example
A result portal: You enter your exam number (input). It shows your results
(output).
Home example
A calculator: You enter 2 + 3 (input). It shows 5 (output).
Nigerian example
A POS machine: You enter the amount (input). It prints a receipt (output).
Illustration
INPUT AND OUTPUT
================
[ Input ] --> [ Program ] --> [ Output ]
Example:
[ 2 + 3 ] --> [ Calculator ] --> [ 5 ]
Another example:
[ account number ] --> [ Bank app ] --> [ balance ]
Mini summary
Input is information going into a program. Output is information coming out.
Every program uses both.
Lesson 11 โ Putting It All Together
Definition
Putting it all together means using variables, data types, lists, functions,
and input/output in one program.
Why it is important
Real programs use all of these together. Understanding how they fit is the key
to writing useful programs.
Simple explanation
Think of a small shop. It has shelves (variables), categories (data types),
item lists (lists), routines (functions), and customers (input/output). All
work together.
Example Program in Pseudocode
START
shoppingList = [ "Rice", "Beans", "Oil" ]
FUNCTION printList(list)
FOR each item in list
print item
END FOR
END FUNCTION
printList(shoppingList)
name = "Amina"
print "Hello, " + name
END
Real-life example
A school portal uses variables for student name, a list for subjects, a
function to calculate average, and input/output to show results.
School example
A school attendance app stores names in a list, uses a function to count
present students, and outputs the total.
Home example
A shopping app stores items in a list, calculates the total, and shows the
receipt.
Nigerian example
A POS machine stores items in a list, uses a function to add prices, and prints
a receipt.
Illustration
PUTTING IT ALL TOGETHER
=======================
[ Variables ] -> [ Data Types ] -> [ Lists ]
| | |
V V V
[ Functions ] -> [ Input/Output ] -> [ Complete Program! ]
Mini summary
Real programs use variables, data types, lists, functions, and input/output
together. Understanding how they fit is key.
Lesson 12 โ Becoming a Programmer
Definition
Becoming a programmer means using logic to solve problems with code. You have
all the basics now.
Why it is important
Programming is a valuable skill. It lets you build apps, solve problems, and
help others.
Simple explanation
Think of learning to ride a bicycle. First you learn balance. Then pedalling.
Then steering. Once you know these, you can ride anywhere. Programming is the
same.
Steps to Become a Programmer
- Learn to think in steps (Module 1).
- Learn decisions and loops (Module 2).
- Learn to store and use information (Module 3).
- Choose a programming language (like JavaScript).
- Practice with small projects.
- Learn HTML, CSS, and JavaScript for web development.
- Keep learning and building.
Real-life example
A person who learns to code can build a website, an app, or a game.
School example
A student who learns to code can build a class project website or a simple
quiz app.
Home example
A young person can build a website for a family business and help it grow.
Nigerian example
Many Nigerians have learned to code and now work for companies around the
world. You can do it too.
Illustration
BECOMING A PROGRAMMER
=====================
[ Learn to think in steps ]
|
V
[ Learn decisions and loops ]
|
V
[ Learn variables and data ]
|
V
[ Choose a language ]
|
V
[ Build small projects ]
|
V
[ Build bigger projects ]
|
V
[ Celebrate! ๐ ]
Mini summary
Becoming a programmer means using logic to solve problems. You have all the
basics now. Keep learning and building.
Summary of Main Lessons
You have now learned the core ideas of Module 3: variables, naming variables, data
types, numbers, text, true/false, lists, using lists, functions, input/output, and
how everything fits together.
5. Key Vocabulary
| Word |
Simple Definition |
| Variable |
A named box that stores information. |
| Data type |
The kind of information stored in a variable. |
| Number |
A data type for counting and calculating. |
| Text (String) |
A data type for words and letters. |
| True/False |
A data type with only two values. |
| List (Array) |
A way to store many items in one variable. |
| Item |
One piece of information in a list. |
| Function |
A block of steps you can use again and again. |
| Input |
Information that goes into a program. |
| Output |
Information that comes out of a program. |
| Call |
Using a function by its name. |
| Parameter |
Information you give to a function. |
| Return |
Information a function gives back. |
| Value |
What is stored inside a variable. |
| Assign |
Putting a value into a variable. |
Summary of Key Vocabulary
These words will help you understand how programs store and use information. Use
them often so they become easy.
6. Important Concepts
Concept 1 โ Information Needs a Name
Variables give information a name so programs can find it later.
Concept 2 โ Information Has a Type
Numbers, text, and true/false are different. Programs handle them differently.
Concept 3 โ Lists Keep Things Together
Lists store many items in one place. They are perfect for going through items one
by one.
Concept 4 โ Functions Save Time
Functions are reusable blocks of steps. Write once, use many times.
Concept 5 โ Programs Take Input and Give Output
Every useful program receives information and produces a result.
Summary of Important Concepts
These five concepts are the heart of Module 3. Read them again before moving on.
7. Step-by-step Explanations
Step-by-step: How to Use a Variable
- Choose a name. Use a clear word, like "score".
- Put a value inside. For example, score = 0.
- Use the variable. Add to it, print it, or check it.
- Change it if needed. score = score + 1.
- Read it when needed. print score.
USING A VARIABLE
================
score = 0
score = score + 1
score = score + 1
print score
Output: 2
Step-by-step: How to Use a List
- Create the list. Write items inside square brackets.
- Read an item. Use its position number.
- Add an item. Use "add" or "append".
- Remove an item. Use "remove".
- Loop through items. Use a for loop.
USING A LIST
============
fruits = [ "Mango", "Banana", "Orange" ]
print fruits[0] -> Mango
print fruits[1] -> Banana
FOR each fruit in fruits
print fruit
END FOR
Step-by-step: How to Write a Function
- Choose a name. Use a clear word, like "greet".
- List the inputs. What does it need? For example, "name".
- Write the steps. What should it do?
- End the function. Use END FUNCTION.
- Call the function. Use its name and pass inputs.
WRITING A FUNCTION
==================
FUNCTION greet(name)
print "Hello, " + name
END FUNCTION
greet("Amina")
greet("Chidi")
Output:
Hello, Amina
Hello, Chidi
Summary of Step-by-step Explanations
Using variables, lists, and functions all follow clear steps. Following steps
makes it easy.
8. Real-life Examples
Example 1 โ A Shopping Cart
A shopping cart uses a list to store items. It uses a function to calculate the
total. It uses input (the items you choose) and output (the receipt).
Example 2 โ A Bank Account
A bank uses variables to store your name and balance. It uses a function to add or
subtract money.
Example 3 โ A Music Player
A music player stores songs in a list. It uses a function to play each song.
Example 4 โ A School Portal
A school portal stores student names in a list. It uses a function to calculate
the average score.
Example 5 โ A Calculator
A calculator uses variables for numbers. It uses functions for addition and
subtraction.
Summary of Real-life Examples
Variables, lists, and functions appear in shopping carts, banks, music players,
school portals, and calculators.
9. Nigerian Examples
Example 1 โ POS Machine
A POS machine stores items in a list. It uses a function to calculate the total.
It shows the receipt as output.
Example 2 โ Bank Transfer
A bank stores your balance in a variable. It uses a function to transfer money.
Example 3 โ School Result Portal
A school portal stores each student's name and scores. It uses a function to
calculate the grade.
Example 4 โ Pure Water Seller
A pure water seller uses a variable to track bags sold. Each bag sold adds to the
variable.
Example 5 โ Jumia and Konga
These online stores use variables for prices, lists for products, and functions
for calculating totals.
Summary of Nigerian Examples
Nigeria has many examples of variables, lists, and functions in POS machines,
banks, schools, and shops.
10. Fun Examples Children Can Relate To
Example 1 โ Video Game Score
A game stores your score in a variable. Every point adds to it.
Example 2 โ A Playlist
A music playlist is a list of songs. The app plays each one.
Example 3 โ A Pencil Case
A pencil case is like a list of items: pens, pencils, erasers.
Example 4 โ A Recipe
A recipe is like a function. You follow the same steps each time.
Example 5 โ A Sports Team
A team is a list of players. The coach uses a function to select the starting
eleven.
Summary of Fun Examples
Variables, lists, and functions appear in video games, playlists, pencil cases,
recipes, and sports teams.
11. Everyday Examples
| Task |
Variable |
List |
Function |
| Shopping |
Total price |
Items to buy |
Calculate total |
| Cooking |
Number of servings |
Ingredients |
Cook rice |
| Charging phone |
Battery level |
Apps open |
Charge battery |
| Going to school |
Time left |
Subjects for the day |
Attend class |
| Sending a text |
Message length |
Contacts |
Send message |
Summary of Everyday Examples
Even simple daily activities use variables, lists, and functions.
12. Parent Tips
-
Point out variables in daily life. The score in a game, the
price of an item.
-
Show lists. The shopping list, the class register, the
timetable.
-
Explain functions. A recipe, a routine, a chore.
-
Play with numbers. Ask your child to calculate the total cost
of items.
-
Encourage naming. Let your child name things clearly.
-
Use simple games. "Let's make a list of things to buy."
-
Praise good organisation. When your child organises things
well, praise them.
-
Be patient. Learning takes time.
Summary of Parent Tips
Parents can help children understand variables, lists, and functions through daily
activities.
13. Interesting Facts
-
The word "variable" comes from the Latin word "variabilis", meaning
"changeable".
-
Lists can hold millions of items.
-
Functions can be reused thousands of times in one program.
-
The most common data types in programming are numbers, text, and true/false.
-
Some programming languages check data types automatically. Others do not.
-
Input and output are the two-way conversation between users and programs.
-
Even the simplest calculator uses variables and functions.
-
In Nigeria, many coding schools start with variables, lists, and functions.
Summary of Interesting Facts
Variables, lists, and functions are powerful, common, and used everywhere.
14. Did You Know?
-
Did you know that every app you use stores information in
variables?
-
Did you know that a list can grow or shrink as the program
runs?
-
Did you know that functions make programs shorter and easier
to fix?
-
Did you know that input can come from a keyboard, a file, or
even another program?
-
Did you know that output can be text, images, sounds, or
files?
-
Did you know that learning variables is the first step to
learning any programming language?
Summary of Did You Know?
Variables, lists, functions, and input/output are the foundation of every program.
15. Remember This
- A variable is a named box that stores information.
- Good variable names are clear and short.
- A data type tells the program what kind of information is stored.
- The three main data types are numbers, text, and true/false.
- A list stores many items in one variable.
- Using a list means adding, removing, reading, and looping.
- A function is a reusable block of steps.
- Input is information going into a program.
- Output is information coming out of a program.
- Real programs use variables, lists, and functions together.
Summary of Remember This
These ten points are the heart of Module 3. Read them again before finishing the
course.
16. Common Mistakes
-
Using vague variable names. "x" and "a" are hard to
understand.
-
Mixing data types. Trying to add a number to text.
-
Forgetting to put text in quotes. Text needs quotes:
"Hello".
-
Using the wrong position in a list. Most lists start at
position 0.
-
Forgetting to call a function. Defining it is not enough.
-
Not handling input. Programs should check what the user
enters.
-
Making functions too long. Keep them short and clear.
-
Giving up too soon. Practice is the key.
Summary of Common Mistakes
Avoiding these mistakes will make you a better programmer than many adults.
17. Best Practices
- Use clear variable names.
- Choose the right data type for the job.
- Keep lists organised.
- Use functions for repeated steps.
- Keep functions short and focused.
- Always validate input.
- Test your program with different inputs.
- Write pseudocode before real code.
- Comment your code so others understand.
- Practice every day.
Summary of Best Practices
These ten practices will help you write better programs.
18. ASCII Illustrations, Diagrams, Flowcharts, and Timelines
Diagram 1 โ Variables Are Like Labelled Jars
VARIABLES ARE LIKE LABELLED JARS
================================
[ Sugar ] <- variable holding sugar
[ Salt ] <- variable holding salt
[ Rice ] <- variable holding rice
Diagram 2 โ Three Data Types
THREE DATA TYPES
================
Number: age = 13
balance = 5000
Text: name = "Amina"
city = "Kano"
True/False: isRaining = true
isPassed = false
Diagram 3 โ A List
A LIST IS LIKE A SHOPPING LIST
==============================
shoppingList = [ "Rice", "Beans", "Oil", "Salt" ]
Item 1: "Rice"
Item 2: "Beans"
Item 3: "Oil"
Item 4: "Salt"
Diagram 4 โ A Function
A FUNCTION IS LIKE A RECIPE
===========================
FUNCTION greet(name)
print "Hello, " + name
END FUNCTION
greet("Amina") -> "Hello, Amina"
greet("Chidi") -> "Hello, Chidi"
Diagram 5 โ Input and Output
INPUT AND OUTPUT
================
[ Input ] --> [ Program ] --> [ Output ]
Example:
[ 2 + 3 ] --> [ Calculator ] --> [ 5 ]
Diagram 6 โ Putting It All Together
PUTTING IT ALL TOGETHER
=======================
[ Variables ] -> [ Data Types ] -> [ Lists ]
| | |
V V V
[ Functions ] -> [ Input/Output ] -> [ Complete Program! ]
Summary of Illustrations
These diagrams help you see how programs store and use information. Draw them
yourself to remember them better.
19. Comparison Tables
Table 1 โ The Three Data Types
| Number |
Text (String) |
True/False |
| For counting and calculating |
For words and letters |
For yes-or-no questions |
| Example: 5, 100, 3.14 |
Example: "Amina", "Hello" |
Example: true, false |
| Can be added |
Can be joined |
Can be checked |
Table 2 โ Variable vs List
| Variable |
List |
| Holds one item |
Holds many items |
| Example: name = "Amina" |
Example: fruits = ["Mango", "Banana"] |
| Simple |
More powerful |
Table 3 โ Input vs Output
| Input |
Output |
| Information going in |
Information coming out |
| From the user, keyboard, file |
To the screen, printer, file |
| Example: typing a name |
Example: showing a greeting |
Summary of Comparison Tables
Comparing ideas side by side helps you remember the differences clearly.
20. Summary After Every Lesson (Consolidated)
| Lesson |
Main Idea |
| Lesson 1 |
A variable is a named box that stores information. |
| Lesson 2 |
Good variable names are clear and short. |
| Lesson 3 |
A data type tells what kind of information is stored. |
| Lesson 4 |
Numbers are used for counting and calculating. |
| Lesson 5 |
Text is used for words and letters. |
| Lesson 6 |
True/False is used for yes-or-no questions. |
| Lesson 7 |
A list stores many items in one variable. |
| Lesson 8 |
Using a list means adding, removing, reading, and looping. |
| Lesson 9 |
A function is a reusable block of steps. |
| Lesson 10 |
Input goes into a program. Output comes out. |
| Lesson 11 |
Real programs use all these parts together. |
| Lesson 12 |
Anyone can become a programmer with practice. |
21. End-of-Module Summary
Congratulations! You have completed Module 3. Let us review what you have learned.
You began by learning that a variable is a named box that stores
information. You learned how to give variables good names.
You discovered data types โ the kind of information a variable
holds. You learned about numbers, text, and
true/false.
You explored lists โ ways to store many items in one variable.
You learned how to add, remove, read, and loop through items.
You learned about functions โ reusable blocks of steps. Functions
save time and keep programs organised.
You discovered input and output โ how programs receive and send
information.
Finally, you learned how to put it all together and how to become
a programmer.
MODULE 3 SUMMARY MAP
====================
[ Variables ] --> [ Data Types ] --> [ Lists ]
|
V
[ Functions ] --> [ Input/Output ] --> [ Complete Program! ]
|
V
[ You can now store and use information! ]
Well done! You have completed the entire Programming Logic for Web Developers
course. You now have the logical foundation to learn any programming language.
22. Frequently Asked Questions (10 Questions)
Question 1: What is a variable in the simplest words?
A variable is a named box that stores information in a program.
Question 2: Why do variable names matter?
Clear names make programs easy to read and understand. Bad names cause confusion.
Question 3: What is a data type?
A data type tells the program what kind of information is stored โ a number, text,
or true/false.
Question 4: What are the three main data types?
Numbers, text (strings), and true/false.
Question 5: What is a list?
A list stores many items in one variable. Each item can be used separately.
Question 6: What is a function?
A function is a reusable block of steps. You write it once and call it whenever
needed.
Question 7: What is input?
Input is information going into a program, like typing your name.
Question 8: What is output?
Output is information coming out of a program, like showing your greeting on the
screen.
Question 9: Can I use variables, lists, and functions in real life?
Yes! You already use them for shopping lists, recipes, and routines.
Question 10: What should I learn next?
After this course, you can learn HTML, CSS, and JavaScript for web development.
23. Matching Exercises
Exercise 1 โ Match the Word to the Meaning
| Column A (Word) |
Column B (Meaning) |
| 1. Variable |
A. A reusable block of steps |
| 2. Data type |
B. A named box that stores information |
| 3. List |
C. Information going into a program |
| 4. Function |
D. A way to store many items |
| 5. Input |
E. The kind of information stored |
Answers: 1-B, 2-E, 3-D, 4-A, 5-C
Exercise 2 โ Match the Example to Its Type
| Column A (Example) |
Column B (Type) |
| 1. age = 13 |
A. Text |
| 2. name = "Amina" |
B. True/False |
| 3. isRaining = true |
C. Number |
| 4. fruits = ["Mango", "Banana"] |
D. List |
Answers: 1-C, 2-A, 3-B, 4-D
Summary of Matching Exercises
Matching helps you connect words to meanings quickly.
24. Scenario-based Exercises
Scenario 1 โ The Lost Score
A game developer forgets to store the score in a variable. Every time the game
restarts, the score is lost.
Questions:
- What is missing?
- What should the developer do?
- Write pseudocode for storing the score.
Scenario 2 โ The Confused Shopping Cart
An online shop stores each item in a separate variable. After 50 items, the
developer gets confused.
Questions:
- What is the problem?
- What should the developer use instead?
- How would a list help?
Scenario 3 โ The Repeated Code
A developer writes the same 10 lines of code 20 times in a program. The program
is very long and hard to fix.
Questions:
- What should the developer use?
- How does this help?
- What is the name of this feature?
Summary of Scenario-based Exercises
These scenarios help you apply what you have learned to real situations.
25. Group Activity
Activity: Plan a Simple Shopping Program
Group size: 3โ5 students
Time: 40 minutes
Materials: Paper, pencil, ruler
Instructions:
- Imagine a small shop that sells 5 items.
- Create variables for the shop name and total sales.
- Create a list of items and their prices.
- Write a function to calculate the total price of an order.
- Write a loop that shows all items.
- Present your program to the class.
Goal: To practise using variables, lists, and functions together.
26. Individual Activity
Activity: My Personal Variables
Time: 20 minutes
Materials: Notebook, pencil
Instructions:
- Write 5 variables that describe you (e.g., myName, myAge).
- Write what data type each variable is.
- Write one list of your favourite foods.
- Write one function that takes your name and prints a greeting.
- Write the input and output of your function.
Goal: To connect variables, lists, and functions to your own life.
27. Mini Project
Project: Design a Simple Grade Calculator on Paper
Time: 1โ2 hours
Materials: Paper, pencil, ruler
Instructions:
- Create a list of 5 subjects.
- Create a variable for each score.
- Write a function to calculate the average score.
- Use an if/else to decide the grade (A, B, C, D, F).
- Print the results as output.
- Draw a flowchart of your program.
- Present it to the class.
Goal: To combine variables, lists, functions, decisions, and loops.
28. Practical Assignment
Assignment: Observe Information Storage in Daily Life
Time: 1 week
Materials: Notebook, pencil
Instructions:
- For one week, look for examples of variables, lists, and functions in daily
life.
- Write down at least 5 examples of each.
- For one example, write pseudocode using variables and a list.
- For one example, write pseudocode for a function.
- Write a short report on what you learned.
Goal: To see how programs store and use information, just like real
life.
29. Key Takeaways
- A variable is a named box that stores information.
- Good variable names are clear and short.
- A data type tells what kind of information is stored.
- The three main data types are numbers, text, and true/false.
- A list stores many items in one variable.
- Using a list means adding, removing, reading, and looping.
- A function is a reusable block of steps.
- Input is information going into a program.
- Output is information coming out of a program.
- Real programs use all these parts together.
30. Classroom Discussion Questions
- Why do programs need variables?
- Can you give an example of a variable from your daily life?
- Why do you think data types matter?
- What is the difference between a variable and a list?
- Can you think of a list from your daily life?
- Why do you think functions are useful?
- What is the difference between input and output?
- Can you give an example of input and output from a bank app?
- Why do you think programs need both input and output?
- What did you enjoy most in this module?
31. Course Completion & Next Steps
You have completed the entire Programming Logic for Web Developers course. Well
done! Here is what to do next.
-
Review all modules. Go back through Module 1, 2, and 3. Make
sure you can explain every key idea in your own words.
-
Finish your final project. Complete the design you started in
this module.
-
Start learning HTML. Free resources like W3Schools can help
you begin.
-
Practice logic daily. Write pseudocode for simple tasks.
-
Learn a real language. JavaScript is a great next step for web
development.
-
Build small projects. A to-do list, a simple calculator, or a
quiz.
-
Keep learning. Programming is a journey. Enjoy it.
YOUR COURSE JOURNEY
===================
[ Module 1: Thinking in Steps ]
|
V
[ Module 2: Making Decisions and Repeating Tasks ]
|
V
[ Module 3: Storing and Using Information ]
|
V
[ You can now think like a programmer! ] ๐
Next step: Learn HTML, CSS, and JavaScript.
Congratulations on completing the course. Keep thinking, keep practising, and one
day you will build something amazing.