Programming & Web Development

Class 6 · Ages 11–12
And He taught man that which he knew not. (96:5)
Programming Concepts · HTML · Computer Systems · Data Representation · Internet · Cybersecurity · Islamic Ethics

Learning Objectives

Topic 1 Introduction to Programming

What is Programming?

Programming (also called coding) is the process of writing instructions for a computer to follow. These instructions are written in a programming language that the computer can understand.

Think of programming like giving a recipe to a very fast and literal chef. The computer does exactly what you tell it – nothing more, nothing less. That's why precision is so important in programming.

Fun Fact!

The first programming languages were developed in the 1950s. Today, there are over 700 programming languages!

Programming Languages

  • Python – A beginner-friendly language used for web development, data science, and AI. Great for beginners!
  • JavaScript – Used to make websites interactive and dynamic. Essential for web development.
  • HTML/CSS – Not programming languages, but used to structure and style web pages.
  • Scratch – A block-based language that makes learning programming fun and visual. Great for learning concepts!
🐍 Python 📜 JavaScript 🌐 HTML/CSS 🧩 Scratch
Popular Programming Languages

Key Programming Concepts

  • Variables – Containers that hold data (like numbers, text, or true/false values).
    name = "Ahmed" # A variable storing text
    age = 12 # A variable storing a number
  • Data Types – Categories of data that programming languages understand. Examples: integers (whole numbers), floats (decimals), strings (text), booleans (True/False).
  • Conditions – Making decisions in code using if/else statements.
    if age >= 18:
        print("You are an adult")
    else:
        print("You are a minor")
  • Loops – Repeating code multiple times.
    for i in range(5):
        print("Hello!") # Prints "Hello!" 5 times
Try This!

Think of a task you do every day.

Can you break it down into steps like a program? For example: "Making breakfast" could be:

1. Take a bowl.
2. Add cereal.
3. Pour milk.
4. Eat with a spoon.

That's programming logic!

Activity

Create a simple algorithm for a task of your choice.

Choose one:
1. How to make a sandwich
2. How to brush your teeth
3. How to tie your shoelaces

Write the steps in order. Then, think about:
• What would happen if you changed the order of steps?
• What would happen if you missed a step?

Discuss your algorithm with a partner.

Reflect

Allah has created the universe with order and patterns. The Qur'an says: "And everything with Him is by measure." (13:8)

Programming is a way of thinking in an orderly way. When we write code, we are using the intellect that Allah has given us. Use your skills to solve problems and help others.

Key Takeaway

Programming is writing instructions for computers. Key concepts include variables, data types, conditions, and loops. Different programming languages have different uses. Programming teaches logical thinking and problem-solving skills.

Topic 2 HTML: Building Web Pages

What is HTML?

HTML (HyperText Markup Language) is the standard language used to create web pages. It provides the structure of a webpage – like the skeleton of a building.

HTML uses tags (like <h1> and <p>) to tell the web browser how to display content.

Fun Fact!

HTML was created by Tim Berners-Lee in 1991. The first webpage was about how to create web pages!

Basic HTML Structure

Every HTML document has a basic structure:

<!DOCTYPE html> <!-- Tells the browser this is HTML5 -->
<html> <!-- The root element -->
<head> <!-- Contains meta information -->
    <title>My First Page</title> <!-- The page title -->
</head>
<body> <!-- The visible content -->
    <h1>Welcome to My Website</h1>
    <p>This is my first web page!</p>
</body>
</html>

Common HTML Tags

  • <h1> to <h6> – Headings (h1 is the biggest, h6 is the smallest).
  • <p> – Paragraph text.
  • <img> – Images (self-closing tag).
    <img src="photo.jpg" alt="A beautiful scene">
  • <a> – Links to other pages.
    <a href="https://www.example.com">Click here</a>
  • <ul> and <li> – Unordered (bulleted) lists.
    <ul>
        <li>Apple</li>
        <li>Banana</li>
    </ul>
  • <div> – A container for grouping content.
Try This!

Create a simple HTML page:

1. Open Notepad (or any text editor).
2. Type the HTML code shown above.
3. Save the file as "my_page.html".
4. Double-click the file to open it in your web browser.

You've created your first web page!

Activity

Create an HTML page about your favorite hobby.

Include:
1. A title (using <h1>)
2. A paragraph describing your hobby.
3. A list of things you need for your hobby.
4. An image (you can use a placeholder URL).
5. A link to a website about your hobby.

Save your page and open it in a browser.

Reflect

Creating web pages is a way to share information with the world. The Prophet ﷺ said: "Convey from me even if it is one verse."

When you create a website, you can share knowledge, inspire others, and help people. Use this skill for good!

Key Takeaway

HTML is the standard language for creating web pages. It uses tags like <h1>, <p>, <img>, and <a> to structure content. Every HTML page has a head (meta information) and a body (visible content). HTML is the foundation of all websites.

Topic 3 Computer Systems

What is a Computer System?

A computer system is a combination of hardware (the physical parts you can touch) and software (the programs that run on it). They work together to process data and perform tasks.

Hardware Components

  • 🧠 CPU (Central Processing Unit) – The "brain" of the computer. It processes all instructions and performs calculations.
  • 💾 RAM (Random Access Memory) – Temporary memory that holds data while the computer is working. It's fast but volatile (loses data when powered off).
  • 💽 Storage (Hard Drive/SSD) – Permanent storage that holds files, programs, and the operating system even when the computer is off.
  • 🔌 Motherboard – The main circuit board that connects all components.
  • ⚡ Power Supply – Provides electricity to all components.
  • 🎮 Graphics Card (GPU) – Processes images and video for display.
🧠 CPU 💾 RAM 💽 Storage 🔌 Motherboard ⚡ Power 🎮 GPU
Hardware Components of a Computer

Software: The Programs

  • System Software – Includes the operating system (like Windows, macOS, or Linux) that manages hardware and provides a platform for other software. Without an operating system, a computer can't run.
  • Application Software – Programs that help you do specific tasks. Examples: Word processors, web browsers, games, and photo editors.
  • Utility Software – Helps maintain and optimize the computer. Examples: Antivirus programs, disk cleaners, and backup tools.
Fun Fact!

The first operating system was created in the 1950s for mainframe computers. Today, we have operating systems for phones, watches, and even cars!

Story: The Computer System

Imagine a computer as a busy office.

The CPU is the manager who makes all the decisions. The RAM is the desk where files are placed while working. The hard drive is the filing cabinet where everything is stored. The motherboard is the office layout that connects everything. The power supply is the electricity that makes everything work.

And the operating system is the manager's assistant who makes sure everything runs smoothly!

Each part has a job, and they all work together!

Activity

Draw a diagram of a computer system.

Include:
1. Hardware (CPU, RAM, Storage, Motherboard).
2. Software (Operating System, Application Software).
3. Arrows showing how they work together.

Label each part and explain its role.

Reflect

Computers are a blessing from Allah that help us in many ways. The Qur'an says: "And He has subjected to you whatever is in the heavens and on the earth..." (45:13).

The design of a computer system reminds us of the complexity and order in Allah's creation. Be grateful for technology and use it to serve humanity.

Key Takeaway

A computer system is made of hardware (CPU, RAM, storage, motherboard) and software (operating system, applications, utilities). Both are essential for a computer to work. The operating system manages hardware and provides a platform for applications.

Topic 4 Data Representation: Binary & Bits

How Does a Computer Store Data?

Computers store all data using binary – a system of only two digits: 0 and 1. Each 0 or 1 is called a bit (binary digit).

Why binary? Because computers are made of switches that can be either ON (1) or OFF (0). It's a very reliable way to represent information.

Fun Fact!

In the early days of computing, binary was stored using punch cards – holes (1) and no holes (0)!

Bits, Bytes, and Beyond

  • Bit – The smallest unit of data (0 or 1).
  • Byte – 8 bits grouped together. A byte can represent 256 different values (from 00000000 to 11111111). One byte can store a single character (like the letter 'A').
  • Kilobyte (KB) – 1,024 bytes (about 1000 bytes).
  • Megabyte (MB) – 1,024 KB (about 1 million bytes).
  • Gigabyte (GB) – 1,024 MB (about 1 billion bytes). Most phones have 64GB, 128GB, or more.
  • Terabyte (TB) – 1,024 GB (about 1 trillion bytes). Used for large servers and data centers.
bit Byte (8 bits) KB (1024 bytes) MB (1024 KB) GB (1024 MB) TB (1024 GB)
Units of Data Storage

Converting Binary to Decimal

Binary numbers use place values that are powers of 2. Each position in a binary number represents a different power of 2:

Place values: 128 64 32 16 8 4 2 1
Binary number: 0 1 0 1 0 1 0 1
64 + 16 + 4 + 1 = 85

Example: The binary number 1010101 equals 64 + 16 + 4 + 1 = 85 in decimal.

Try This!

Practice converting binary to decimal:

1. 00000001 = ? (Answer: 1)
2. 00000010 = ? (Answer: 2)
3. 00000100 = ? (Answer: 4)
4. 00001000 = ? (Answer: 8)
5. 00101010 = ? (Answer: 42)

Can you see the pattern? Each position doubles the value.

Activity

Convert these binary numbers to decimal:

1. 00010001 = _____
2. 00110011 = _____
3. 01010101 = _____
4. 11110000 = _____
5. 11111111 = _____ (hint: 255!)

Check your answers with a partner.

Reflect

The binary system shows that even the most complex data can be represented by simple patterns of 0s and 1s. The Qur'an says: "And everything with Him is by measure." (13:8)

The order and precision of binary reminds us of the precision in Allah's creation. Everything is created with measure and balance.

Key Takeaway

Computers store data in binary (0s and 1s). A bit is a single 0 or 1. A byte is 8 bits. Larger units are KB, MB, GB, and TB. Binary uses place values based on powers of 2. Understanding binary helps us appreciate how computers work.

Topic 5 The Internet & Web Servers

How Does the Internet Work?

The internet is a global network of computers that communicate with each other. It's like a huge system of roads that connect cities – but instead of cities, we have servers, and instead of roads, we have cables and wireless signals.

Key Components of the Internet

  • 💻 Client (User's Device) – Your computer, phone, or tablet that requests information from the internet.
  • 🌐 Server – A powerful computer that stores websites and sends them to clients when requested. Servers are like libraries – they hold information and share it.
  • 📡 Router – A device that directs traffic on the internet, sending data to the right destination.
  • 🔗 IP Address – A unique address that identifies every device on the internet. Example: 192.168.1.1 (like a postal address for your computer)
  • 🌐 Domain Name – A human-friendly name for a website. Example: www.example.com (easier to remember than an IP address)
💻 Client Asks for info
↔
🌐 Server Sends info
↔
📡 Router Directs traffic
How the Internet Works
Fun Fact!

There are over 5 billion internet users in the world today – that's more than 60% of the global population!

How Web Pages Travel

  • Step 1: You type a website address (like www.example.com) in your browser.
  • Step 2: Your browser asks the Domain Name System (DNS) to find the IP address of that website.
  • Step 3: Your browser sends a request to the server at that IP address.
  • Step 4: The server sends the website files (HTML, CSS, images) back to your browser.
  • Step 5: Your browser displays the website on your screen.
Story: The Request Journey

A student named Aisha wanted to visit a website to learn about animals. She typed the address into her browser and pressed Enter.

Her browser asked the DNS: "Where can I find this website?" The DNS replied: "Here is the IP address."

Her browser sent a request across the internet, through many routers, to the server that held the website. The server replied with the web page, and Aisha's browser displayed it on her screen.

All of this happened in less than a second!

The lesson: The internet is a remarkable system that connects us to information around the world.

Activity

Draw a diagram showing how a web page travels from a server to your computer.

Include:
1. Your computer (client).
2. The internet (cloud).
3. A server.
4. A router.
5. Arrows showing the flow of requests and responses.

Label each part and explain its role.

Reflect

The internet connects people across the world. The Qur'an says: "O mankind, indeed We have created you from male and female and made you peoples and tribes that you may know one another..." (49:13)

The internet is a powerful way to connect with others and share knowledge. Use it to build bridges and help others.

Key Takeaway

The internet is a global network of computers. Clients request information from servers. Routers direct internet traffic. Every device has a unique IP address. Domain names (like www.example.com) are human-friendly names for IP addresses. Understanding the internet helps us use it more effectively.

Topic 6 Cybersecurity & Digital Ethics

What is Cybersecurity?

Cybersecurity is the practice of protecting computers, networks, and data from unauthorized access, attacks, and damage. It's like having a lock on your door – but for the digital world.

Common Cyber Threats

  • 🦠 Viruses and Malware – Malicious software that can harm your computer or steal your data. Protect yourself with antivirus software.
  • 🎣 Phishing – Fake emails or messages that try to trick you into revealing personal information. Never click on suspicious links!
  • 💻 Hacking – Unauthorized access to computer systems. Use strong, unique passwords.
  • 📧 Spam – Unwanted and unsolicited emails. Don't open suspicious emails.
🦠 Malware 🎣 Phishing 💻 Hacking 📧 Spam
Common Cyber Threats
Fun Fact!

The first computer virus, called "Creeper," was created in 1971. It displayed the message: "I'm the creeper, catch me if you can!"

Protecting Yourself Online

  • 🔐 Use Strong Passwords – Mix letters, numbers, and symbols. Example: "MyC@t2024!" instead of "password123"
  • 🛡️ Enable Two-Factor Authentication (2FA) – Add an extra layer of security. You'll need a code from your phone as well as your password.
  • 📱 Think Before You Share – Your digital footprint lasts forever. Once something is online, it's hard to remove.
  • 🔄 Keep Software Updated – Updates often fix security problems. Don't ignore update notifications.
  • 📞 Report Suspicious Activity – Tell an adult if something seems wrong.

Digital Ethics in Islam

  • Honesty – Be truthful online. Don't pretend to be someone else. "And do not mix truth with falsehood..." (2:42)
  • Kindness – Treat others with respect online. No bullying or hate speech. "And speak to people good words." (2:83)
  • Privacy – Respect others' privacy. Don't share personal information without permission. "And do not spy..." (49:12)
  • Responsibility – Use technology for good and avoid harm. "And cooperate in righteousness and piety..." (5:2)
  • Gratitude – Appreciate the blessing of technology and use it wisely. "And whatever you have of favor is from Allah." (16:53)
Story: The Responsible User

A student named Ibrahim received a suspicious email that said he had won a prize. He felt excited but remembered his teacher's lesson about cybersecurity.

He did not click the link. Instead, he showed his parents, and they confirmed it was a phishing scam. Ibrahim had protected himself by thinking before clicking.

The lesson: Always be cautious online. If something seems too good to be true, it probably is. Protect yourself and others by being careful.

Activity

Create a "Cybersecurity Tips" poster.

Include:
1. 5 tips for staying safe online.
2. A picture or icon for each tip.
3. A quote from the Qur'an or Hadith about honesty or kindness.

Share your poster with your class or family.

Reflect

Cybersecurity is about protecting ourselves and others. The Prophet ﷺ said: "The best of people are those who are most beneficial to others."

When we use technology safely and ethically, we are protecting ourselves and benefiting others. Be a responsible digital citizen.

Key Takeaway

Cybersecurity protects computers, networks, and data from threats. Common threats include malware, phishing, hacking, and spam. Protect yourself with strong passwords, 2FA, and caution online. In Islam, digital ethics include honesty, kindness, privacy, responsibility, and gratitude. Use technology safely and ethically.

Class 6 Computer Science – Complete!

You've explored programming concepts, HTML, computer systems, data representation, the internet, and cybersecurity. You are now ready to continue your journey into the world of computer science! May Allah bless your learning and help you use technology for good!

Topic 1 Topic 2 Topic 3 Topic 4 Topic 5 Topic 6