Knowledge That Moves You Forward - ElimBora
Showing posts with label form 2. Show all posts
Showing posts with label form 2. Show all posts

Tuesday, 18 August 2026

INTRODUCTION TO PROGRAMMING LANGUAGE | FORM 2 FULL NOTES

›
Programming is the process of creating a set of instructions that a computer can follow to perform specific tasks or solve problems.  
It involves writing code in a language the computer can understand and execute. In simple terms, programming is how humans communicate with computers to make them perform desired actions.  
Computer programming is the process of writing instructions that a computer can understand and execute.  
These instructions are written in a programming language and tell the computer what to do, step by step, to complete a task or solve a problem.
Real life example:  
Imagine you are making ugali. You need to follow a series of steps in a specific order to make it successful. 
The instructions for making ugali would be like programming: 
Step 1: Boil water in a pot. 
Step 2: Gradually add maize flour (cornmeal) while stirring. 
Step 3: Continue stirring until the mixture thickens. 
Step 4: Cook until the mixture is firm and no longer sticky. 
 
These steps must be followed precisely, just like writing code in a program. If you skip a step or get the order wrong, you might end up with a different result (such as, watery ugali or burnt flour). Similarly, in programming, if you do not follow the correct syntax or sequence of instructions, the program will not run as expected, and you will get errors or incorrect results. 
Reasons for learning programming 
From smartphones and smart home devices to websites and business systems, programming is the foundation of most modern technologies. Learning to program helps you understand and shape the digital world around you. 
Creativity and problem-solving: Coding allows you to create apps, games, and software solutions. 
High-demand careers: Programming skills are in high demands across almost every industry or organization, open job opportunities in many industries, including technology, healthcare, education, entertainment, finance and many others. 
 
Tasks automation: Programming can help in automating repetitive tasks to improve efficiency and accuracy. For example, programming can save time of manual effort in various activities such as data processing, file management, and many others. 
Cross-industry Skills: A person that learn how to program, can work in a variety of fields, including web development, mobile app development, artificial intelligence, machine learning, game development, data science, and more. 
 
Importance of programming 
Development of Daily Technology: Programming helps in developing technologies used every day. Example: Mobile money systems like M-Pesa, Tigo Pesa, and Airtel Money in Tanzania rely on programming to allow people to send and receive money easily. 
Solving Real-Life Problems: Programming is useful for solving real-life challenges in society. Example: Systems used by TANESCO for billing and tracking electricity usage are built using programming to reduce errors and improve service delivery. 
Opportunities: Learning programming opens doors to good careers and self-employment. Example: Many Tanzanian youths work as software developers, website designers, orappdevelopers, creating apps for local businesses and schools. 
Understanding How Computers Work: Programming helps people understand how computers and technology operate. Example: Students in Tanzanian colleges like DIT and UDSM learn programming to understand how systems such as student registration portals function. 
Increasing Efficiency in Industries: Programming makes work faster and easier in different industries. Example: Banks in Tanzania, such as NMB and CRDB, use programmed systems for ATM services and online banking. 
Reducing Errors and Improving Accuracy: Programming reduces human errors by automating tasks. Example: NECTA examination results processing uses computer programs to ensure accurate marking and results management. 
Supporting Development in Advanced Fields: Programming supports progress in areas like artificial intelligence, healthcare, and data analysis. Example: Hospitals in Tanzania use electronic health record systems to store and analyze patient information. 
Enabling Global Communication: Programming makes global communication possible through the 
Internet and social media. Example: Tanzanians use WhatsApp, Facebook, and Zoom to communicate locally and internationally for business and education. 
Creating and Customizing Software: Programming allows people to create and adjust software for specific needs. Example: Local developers create school management systems for Tanzanian primary and secondary schools. 
Supporting Science and Education: Programming is important in scientific research and education. Example: Tanzanian universities use online learning platforms and research software developed through programming. 
Role of programming languages 
Programming languages are essential tools in software development, enabling developers to create, modify, and maintain software applications.   
The roles of programming languages in software development include: 
Allowing developers to write step-by-step commands that instruct computers to perform specific tasks efficiently. 
Enabling the creation of various types of software, including web applications, mobile apps, desktop programs, operating systems, and enterprise solutions. 
Automating repetitive processes increases productivity and efficiency in healthcare, finance, and manufacturing industries. 
Aiding in software security by preventing vulnerabilities, mitigating cyber threats, and ensuring system stability and data privacy. 
Enabling developers to write high-performance code that optimises software efficiency, reduces processing time, and improves responsiveness. 
Understanding Computers and Programming: From Hardware to Code 
A computer functions because of a combination of hardware and software. Hardware carries out the tasks, while software provides instructions to follow. Together, they allow the computer to perform different functions and respond to user commands. 
 
Hardware (the physical part) 
Hardware is the part of a computer you can see and touch. The main parts of the hardware are: 
CPU (Central Processing Unit) – This is the computer’s brain that follows instructions in programs. 
RAM (Main Memory) – This stores data that the computer uses currently. It is fast but temporary. 
Storage (Hard Drive or SSD) – This saves data for later use, such as photos or schoolwork. 
Input devices – This helps you give commands to the computer, like a keyboard or mouse. 
Output devices – This shows results, like a monitor or printer. 
 
Software (the invisible part) 
Software is a collection of instructions or programs that direct a computer's hardware to perform  specific tasks. It includes the programs and apps that run on the computer. There are two main types: 
System software – Helps the computer run, like Windows or macOS. 
Application software – Lets you do tasks like typing, drawing, or browsing the Internet. 
There are also tools like virus scanners and backup programs that help keep the computer safe and fast. 
 
How computers store data 
Computers use binary, which is just 0s and 1s, to store everything—words, pictures, music, and more. 
A “bit” is a single 0 or 1. 
A “byte” is 8 bits, and can store one small piece of information, like a letter. 
For example: 
The letter “A” is stored as 01000001 
The number “157” is stored as 10011101 
Bigger numbers need more bytes. Computers can combine bytes to store large values like 65,535 or even more. 
 
Storing text, numbers, and media 
Texts use systems like ASCII and Unicode to convert letters into binary. 
Images are made of tiny dots called pixels, each stored as numbers (iii) Sound is saved in small pieces (samples), also stored as numbers. 
 
How a program works 
When you run a program, it consists of many small instructions that the computer must follow. These instructions are executed by the CPU (Central Processing Unit), which is often referred to as the 'brain' of the computer. 
How the CPU follows instructions The CPU does simple things like: 
Reading from memory 
Doing calculation 
Moving data 
Comparing numbers 

By doing many small steps very fast, it can complete large tasks. 
 
How programs are written 
Computers only understand machine language, which is a long list of 0s and 1s. 
Writing in machine language is hard, so we use assembly language, which uses easy words like: 
ADD (add numbers) 
MOV (move data) 
A program called an assembler changes assembly language into machine language so the CPU can understand it. 
Where programs are stored 
Programs are saved on hard drives. When you open them, they are copied to RAM. The CPU then fetches and executes instructions directly from RAM during processing. 
Generally, programming is done by following a few simple steps. The basic process of programming includes: 
Writing a list of instructions (this is called a program). 
Saving the program on the computer. 
Running the program, which loads it into the computer's memory (RAM). 
The CPU reads and follows the instructions to perform the task. 
Important terms in programming 
Understanding the basic terms used in programming is essential for anyone learning to code. These terms form the foundation of how programs are written, understood, and executed. Some of the most important programming terms include: 

Compiler 
A compiler is a special software program that translates code written in a high-level  programming language (such as C, Java, or C++) into machine language (binary code) that a computer's CPU can understand and execute.  
It processes the entire source code at once, converting it into object code or an executable file.  This allows the program to run directly on the computer hardware without needing the source code during execution. 
Compared to interpreters, compilers typically require less time during execution, as the code is already fully compiled.  
The compilation process generally involves several stages, including compiling, linking with system libraries, and executing the program. Common examples of compilers include Dev-C++, Borland C++, and Visual C++.  
To make a computer execute your program, you need a compiler.  
The importance of using a compiler includes: 
Translating source code into machine language – Computers cannot understand English-like C code, so the compiler converts it into binary (machine code). 
Checking for errors – The compiler detects and reports mistakes in your code, helping you correct them before running the program. 
Creating an executable file – After compilation, the compiler generates a file that the computer can run directly. 
 
below is the table of Example of compilers for different programming languages 
Programming Language 
Compilers 
To Download Full Notes Click Here

THE INTERNET | FORM 2 FULL NOTES

›

 

Internet is a vast, global network of interconnected computer networks that allows billions of devices worldwide to exchange information and communicate. This network consists of millions of private, public, academic, business, and government networks, all linked by various electronic, wireless, and optical networking technologies.

Internet vs. the World Wide Web

It is a common misconception that the internet and the World Wide Web are the same thing.

The Internet is the underlying physical and technical infrastructure—the hardware, cables, and protocols that connect computers globally.

The World Wide Web is a service that runs on the internet. It is a collection of linked documents (web pages) and other resources that are accessed via the internet using a web browser. Other services, such as email, also run on the internet


INTERNET TERMINOLOGIES

An Internet Protocol (IP) address is a unique numerical label assigned to every device connected to a computer network that uses the Internet Protocol for communication. Is normally a number that has four parts W,X,YZ. Example 10.50.100.254.

A Media Access Control (MAC) address is a unique identifier assigned to a network interface controller (NIC), which is a piece of hardware that allows a device to connect to a network. It is a permanent physical address embedded in the device by the manufacturer, unlike an IP address, which can change.

A URL, or Uniform Resource Locator, is the unique web address of a resource on the internet, such as a webpage, image, or file. Think of it as a street address that your web browser uses to find and retrieve specific information online, making it a key part of navigating the web. Example https://www.tie.go.publications/ICS.pdf

A web page is a single document accessible online via a web browser, containing text, images, videos, and links to other pages or files. These pages are written in HyperText Markup Language (HTML),

A website is a collection of interconnected web pages, hosted on a server and accessible via the internet through a unique domain name or URL.

A web server is a computer or software system that stores and delivers website content to users over the internet. When a user requests a webpage, their browser sends a request to the web server, which then processes the request and sends back the necessary files, such as HTML pages, images, and videos, using protocols like HTTP.

A hyperlink is a clickable element, like text, an image, or an icon, that connects to another web page, document, or online location.

Hypertext is a form of electronic text that contains clickable hyperlinks to other texts, which can be in the same document or different ones, forming a non-linear path through information.

A web browser is a software application used to retrieve, present, and navigate information on the World Wide Web, allowing users to access websites and view web pages.

An Internet Service Provider (ISP) is a company that provides access to the internet to individuals and businesses. They use technologies like fiber optics, DSL, satellite, or wireless connections to deliver internet access and may also offer related services like email accounts, web hosting, and data communication.

Modem- A modem is a hardware device that connects a computer to the internet by converting digital signals into analog signals for transmission and then converting the incoming analog signals back into digital signals.


HISTORY OF INTERNET.


The internet began with the 1960s development of ARPANET by the U.S. government for research, which evolved into the global network we know today. A key milestone was the 1983 adoption of TCP/IP protocols, which allowed different networks to communicate. In 1989, Tim Berners-Lee invented the World Wide Web, making the internet accessible to the public through websites and browsers, with the first website launching in 1991

Early development (1960s–1980s)

1960s: The concept of a global network emerged, with the U.S. Department of Defense funding ARPANET as a decentralized communication system to withstand nuclear attacks. 

1969: The first message was sent over the ARPANET between UCLA and Stanford, marking the network's operational start. 

1970s: Ray Tomlinson sent the first email and introduced the "@" symbol in addresses. In 1974, Vint Cerf and Bob Kahn developed TCP/IP, the fundamental communication language for the internet. 

1983: The official "birth date" of the internet, when ARPANET officially switched to using the TCP/IP protocol, creating a unified network of networks. 

The rise of the World Wide Web (1990s)

1989: Tim Berners-Lee invented the World Wide Web while at CERN. 

1991: The first website went live, and the Web became publicly accessible. 

1993: The Mosaic web browser was released, the first user-friendly browser for the general public, leading to a rapid increase in websites and users. 

1998: Google was founded, quickly becoming the dominant search engine. 

Modern internet and beyond

2000s: The rise of social media platforms like Facebook (2004) and YouTube (2005), user-generated content (Web 2.0), and the explosive growth of mobile internet access via smartphones changed how people interact online. 

2010s–Present: The internet has continued to evolve with technologies like 5G, the expansion of the Internet of Things (IoT), and ongoing research into decentralized networks (Web 3.0) and virtual worlds

SEARCH ENGINE

A search engine is a software program or system that helps users find information on the internet by searching a massive index of web pages. Users enter keywords or phrases into a search box, and the search engine returns a list of relevant websites, images, or videos, ranked by its algorithm. Popular examples include Google, Bing, MSN and Yahoo.


ACTIVITY

Practice to use MSN search engine to search information about history of computer.


APPLICATION OF INTERNET

The internet provides several services such as e-mail, e-learning, e-commerce, newsgroup, online forums, video and teleconferencing, and social media.


ELECTRONIC EMAIL

Email, short for electronic mail, is a method of exchanging digital messages over a computer network like the internet. It allows users to send and receive text messages, files, and other attachments quickly


Accessing email services:

To access email services, you must have two email account, which associated with an email address. There are two types of email address: Commercial email address and organizational email addresses.

Commercial email Address-These are free email addresses that are created on commercial websites such as Yahoo, Google and Hotmail. Eg. dude@gmail.com.

Organization e-mail Address-These are free email addresses that are created by particular organization to facilitate communication by its staff. Example dani.r@sachoolofstjude.co.tz

HOW TO CREATE COMMERCIAL EMAIL ACCOUNT-GMAIL

To create a Gmail account, go to the Google Account sign-up page and click "Create account" Go to the sign-up page: Navigate to the Google Account creation page or gmail.com and select Create account. Follow steps by providing all necessary information to create your account.


SENDING AN E-MAIL

On email account home page, click on Compose button. A web page will display for you to fill the email address of a receiver, subject or message heading and message to be sent. 

Fill the required information and click Send button: The message will be sent to a person bearing the typed email address.

E MAIL FIELDS

From: The sender's email address. 

To: The primary recipient's email address. 

Cc (Carbon Copy):Email addresses of recipients who are copied on the email but are not the main focus. 

Bcc (Blind Carbon Copy):Email addresses of recipients who are copied on the email, but their addresses are hidden from all other recipients. 

SIGN OUT OR LOGOUT

Sign out is the process of quitting a signed in email account. It is important to prevent unauthorized users access your emails. To sign out click Sign Out button 

SIGNING IN OR LOGIN IN

Is the process of getting into your email account for the purposes of sending new message or reading incoming message. To read new message click INBOX, and to send new message click COMPOSE or New message.  

EMAIL FOLDER

Inbox: All new emails arrive here unless directed elsewhere. 

Drafts: Saves emails you start but don't finish. 

Sent: A copy of every email you send is stored here. 

Junk/Spam: Automatically moves messages that are likely unwanted. 

Deleted Items/Trash: Holds messages you've deleted.



Advantages of email services

Easy to use

Cost effective.

Reliable

Can send longer message than SMS

Allow attachment of various files such as image, video 

Wide access

Neatness

Disadvantages

Lack of personal touch like expression of emotion.

Need user to be computer literate

Can only send specific limited size of file attachment

Security risks: Emails are vulnerable to viruses and phishing scams

Requires internet access-for both sender and receiver






ELECTRONIC LEARNING:

E-learning is an educational approach that delivers learning content and resources using digital technologies and online platforms, allowing for flexible, remote, and accessible education at any time and location

Examples of E-learning

Online Courses: Structured courses delivered entirely online through a learning management system (LMS). 

Virtual Classrooms: Live, synchronous online sessions where instructors and students interact in real-time. 

Webinars: Online seminars or presentations that allow for interactive learning experiences. 

Mobile Learning (M-learning): Educational content accessed through mobile devices like smartphones. 

Blended/Hybrid Learning: A combination of e-learning and traditional in-person instruction


Advantages of e learning


You can have your own learning schedule and your own pace

You can learn at your place without going to the physical school or school

It save cost of transport for both learners and education providers

It can enable to support blended learning, i.e combine face to face and online learning.


Disadvantages of electronic learning


It minimizes social interaction between teachers and students

Internet connection may be required to access some resources and internet can be expensive.

It requires self-motivation as unmotivated student may waste time on other entertaining sites.


ELECTRONIC COMMERCE


E-commerce is the buying and selling of goods and services over the internet, including the transfer of money to complete transactions. It encompasses a wide range of activities, such as online shopping on websites and apps, purchasing digital products, and booking travel and financial investments. E-commerce can occur between businesses and consumers (B2C), between businesses (B2B), or even between individuals. Some of the common application of e commerce are: Online marketing, Online Auction, E banking


Advantages of e commerce

Wider customer base: 

Lower operational costs: 

24/7 availability:

Scalability:

 Customer data and insights: 


Disadvantages of ecommerce

Inability to see, touch, or try products

Shipping costs and delays: 

Difficulty with return

Lack of personal interaction

Security risks

Technical issues such as internet.


ONLINE FORUM

An online forum is a website or platform where people can hold discussions by posting messages and replying to each other's posts, often organized into specific topics or threads. To participates in discussion a person some time need to subscribes using an email address. Example of online forum are Google answers, Quora and Slide share.

VIDEO AND TELE CONFERENCING 

Video and tele conferencing enables conversion between people separated by physical barriers through a web-based system that facilitates things such as family interaction, business meetings and learning activities. Examples of video conferencing tools are Zoom, Google meet, Skype.

SOCIAL MEDIA

Social media refers to internet-based communication platforms that allow users to create and share content, interact with others, and build online communities. These platforms, such as Facebook, Instagram, and X, enable people to share ideas, personal messages, photos, and videos, and they have evolved to include business and news dissemination

ADVANTAGES OF USING INTERNET 

Source of information

Source of entertainment

Online shopping

Communication

Promoting business

Online learning

Telemedicine

E-services such as paying bills

DISADVANTAGES OF THE INTERNET 


Internet addiction 

Cybercrimes

Social Isolation

Measures to reduce negative effects of internet.

Use of antivirus

Use of strong password

Keep your software updated

Managing social media setting

Strengthening your home network

Provide awareness to children about safe use of the internet

Keep up-to-date on major security breaches 

Having in place policies and acts to reduces the negative effects of internet.

MECHANISM OF GASEOUS EXCHANGE IN MAMMALS | FORM TWO TULL NOTES

›


The mechanism of gaseous exchange in mammals is the process by which oxygen (O₂) enters the body and carbon dioxide (CO₂) is removed. It takes place mainly in the alveoli (tiny air sacs) of the lungs through diffusion.

1. Ventilation (Breathing)

  • During inhalation, the diaphragm contracts and flattens while the rib muscles lift the ribs upward and outward.

  • This increases the volume of the chest cavity, lowering air pressure in the lungs.

  • Air rich in oxygen enters through the nose or mouth, passes through the trachea, bronchi, and bronchioles, and reaches the alveoli.

  • During exhalation, the diaphragm relaxes and becomes dome-shaped, and the rib muscles relax.

  • The chest cavity volume decreases, increasing air pressure, forcing air rich in carbon dioxide out of the lungs.

2. Exchange of Gases in the Alveoli

  • The alveoli have thin, moist walls and are surrounded by many blood capillaries.
  • Oxygen concentration is higher in the alveoli than in the blood, so oxygen diffuses across the alveolar wall into the blood.
  • Carbon dioxide concentration is higher in the blood than in the alveoli, so carbon dioxide diffuses into the alveoli to be exhaled.

3. Transport of Oxygen

  • Oxygen combines with haemoglobin in red blood cells to form oxyhaemoglobin.
  • The blood carries oxygen to body tissues.
  • In tissues, oxyhaemoglobin releases oxygen, which diffuses into cells for cellular respiration.

4. Transport of Carbon Dioxide

  • Carbon dioxide produced during respiration diffuses from body cells into the blood.
  • Most CO₂ is transported as bicarbonate ions in the plasma, while some is carried by haemoglobin or dissolved in plasma.
  • In the lungs, bicarbonate ions are converted back to carbon dioxide, which diffuses into the alveoli and is exhaled.

Adaptations of the Alveoli for Efficient Gas Exchange

  • Large surface area: Millions of alveoli provide a vast area for diffusion.
  • Thin walls: Only one cell thick, allowing rapid diffusion.
  • Moist lining: Dissolves gases before they diffuse.
  • Rich blood supply: Maintains a concentration gradient by continuously carrying away oxygen and bringing carbon dioxide.
  • Continuous ventilation: Keeps oxygen levels high and carbon dioxide levels low in the alveoli.

Summary

Gas exchange in mammals occurs by diffusion across the alveoli. Oxygen moves from the alveoli into the blood and is transported to body cells, while carbon dioxide moves from the blood into the alveoli and is expelled during exhalation. Efficient ventilation, a large alveolar surface area, thin moist walls, and a rich blood supply ensure rapid and effective gas exchange

Popular Posts