
Lecture 1: Introduction
Welcome to Learn Programming from Scratch 1.0: The Ultimate Beginners’ Guide (C/C++, Java, Python, and PHP).
This lecture sets the stage for your journey from absolute beginner to confident, job-ready coder.
In this lecture, we will cover:
From zero to coding: We start from scratch—no prior programming knowledge required.
Solid foundations: Core concepts of programming, software development, tools, processes, and how to build lasting skills.
Language-agnostic thinking: Principles that transfer across C/C++, Java, Python, and PHP.
Progressive depth: We’ll build from basic to intermediate to advanced concepts step by step.
From learning to building: Understand languages quickly so you can create websites, apps, desktop software, and more.
Clear and technical: Simple, easy-to-understand explanations without losing the necessary technical accuracy.
Guided learning: Every step is explained and demonstrated—no gaps, no guesswork.
By the end of this lecture, you’ll know what the course includes, how we’ll learn, and what outcomes to expect as you progress.
Lecture 2: Objectives
In this lecture, you’ll discover the goals and outcomes of the course so you know exactly what skills you’ll gain as you progress. By the end of this section, you will:
Understand the fundamentals of programming and the software development ecosystem.
Learn and apply the core features of programming languages through both theory and hands-on practice.
Acquire the ability to quickly grasp new programming languages with confidence.
Develop basic through advanced programming skills that grow with you.
Use programming languages effectively to create small projects and eventually build large, efficient software systems.
Recognize and work with the tools and environments essential for software development.
Write functional, modular, and clean code that scales.
Gain a solid understanding of Object-Oriented Programming (OOP).
Adopt industry best practices for software development.
Build a strong foundation that prepares you for advanced topics and future learning.
Lecture 3: Requirements
Before starting this course, here’s what you’ll need:
No prior programming knowledge required – this course starts from absolute zero.
A stable internet connection to stream lessons and access resources.
A willingness to learn and commit through to the end of the course.
That’s it! If you bring curiosity and consistency, this course will guide you step by step into programming.
Lecture 4: About the Instructor
Your instructor for this course is Cornelius Kasokola, a passionate full-stack developer and tutor with over 7 years of hands-on programming experience.
Professional Background:
Developed a wide range of software including websites, web applications, mobile apps, management systems, libraries, APIs, games, and custom software solutions.
Experienced in freelance work, employment, and hands-on running a software publishing business.
Published articles and books on programming and technology.
Tutored programming and engineering courses for learners at different levels.
Qualifications & Skills:
Pursuing a BSc. in Information and Communication Technology.
Specialized in full-stack web and mobile development across multiple technologies.
Lecture 5: Software and Software Types
In this lecture, we’ll explore what software is, why it’s essential for computers, and the different types that make computing possible. You’ll learn how system, application, and programming software work together to enable everyday tasks and software development, with clear real-world examples.
What is Software?
Software is a set of instructions that tells a computer what to do to accomplish a specific task. Examples include turning a computer on and off or playing a movie.
Types of Software
System (Utility) Software
Helps run, control, and manage the computer’s hardware and core functions.
Examples: Operating System (Windows, Linux), Anti-virus programs, Disk Cleanup tools.
Application (User) Software
Designed to help users perform specific tasks or activities.
Examples: Web browsers (Google Chrome), Microsoft Word, VLC Media Player.
Programming Software
Provides tools for developers to create, test, and debug applications.
Examples: Compilers, Interpreters, Text Editors.
Key Takeaway:
Software brings a computer to life. System software ensures the machine runs, application software helps users accomplish tasks, and programming software allows developers to build new solutions.
Lecture 6: Number Systems
In this lecture, we’ll explore how numbers are represented in computing, which is fundamental for programming and understanding how computers process data.
Key Concepts:
Digit: A single character used to represent numbers, typically 0–9.
Number: A group of digits representing a value, quantity, or position.
Examples: 8 years, $5
Types of Number Systems:
Binary (Machine Language): Uses only 0s and 1s. This is the core number system used by computers.
Octal: Uses digits 0–7.
Decimal: Uses digits 0–9. Commonly used in everyday life.
Hexadecimal: Uses digits 0–9 and letters A–F (representing values 10–15).
Focus:
Binary numbers are the primary system of interest, as all computer operations rely on this system to store, process, and transmit data efficiently.
Key Takeaway:
Understanding number systems, especially binary, is essential for programming, as it forms the foundation for how computers interpret and execute instructions.
Lecture 8: Computer Language
In this lecture, we’ll explore computer language and how it differs from human language. Computers cannot understand human language directly; they only process instructions in binary (0s and 1s), also known as machine language.
Key Concept:
Computers execute all operations using binary code, interpreting 0s and 1s to perform tasks efficiently.
Examples of Computer Language in Action:
Processing images
Playing movies or videos
Running games
Key Takeaway:
Understanding that computers operate in binary helps learners grasp why programming languages are essential—they act as a bridge between human-friendly instructions and machine-executable code.
Lecture 7: Human Language
In this lecture, we’ll explore human language and how it differs from computer language. Understanding this distinction is essential for learning programming and communicating instructions to a computer.
Human Language:
Human language uses a combination of letters, numbers, and symbols to convey ideas, information, and instructions. It is flexible, expressive, and designed for human understanding.
Examples of Human Language in Action:
Reading a newspaper
Shopping at a grocery store
Counting or handling money
Key Takeaway:
Human language is intuitive for people but too ambiguous for computers. Learning how computers interpret precise instructions will help bridge the gap between human communication and programming languages.
Lecture 9: Human-Computer Communication
In this lecture, we’ll explore how humans and computers communicate despite speaking very different “languages.”
Key Challenge:
Humans naturally understand human-readable languages like English, while computers only understand binary (0s and 1s). This creates a communication gap.
Solution:
Programming languages act as a bridge, converting instructions from human-readable language into computer-readable language and vice versa. This allows humans to give precise instructions and computers to execute them efficiently.
Key Takeaway:
Understanding this communication process is essential for programming, as it forms the foundation for writing code that computers can interpret and execute.
Lecture 10: What is a Programming Language?
In this lecture, we’ll introduce the concept of a programming language—the fundamental tool that allows humans to communicate instructions to a computer. A programming language is a structured set of keywords, symbols, rules, and syntax used to write instructions that a computer can understand and execute to perform specific tasks.
Example:
sum = 2 + 2;
Common Symbols:
+, -, *, &&, ||, %, ;, {}, ()
Common Keywords:
class, int, float, break, switch
Conclusion:
Programming languages combine numbers, symbols, and words in a precise way to communicate instructions to a computer efficiently. Understanding these basics is the first step toward writing your own programs and building a strong foundation in software development.
Lecture 11: Key Features of Programming Languages:
In this lecture, we’ll explore the key features that make programming languages effective for communicating with computers.
1. Syntax:
The set of grammar rules that define how code must be written. Just like human languages such as English or Spanish, correct syntax ensures the instructions are understood.
2. Semantics:
The meaning behind each instruction. Semantics ensures that the computer executes the instructions exactly as intended.
3. Keywords:
Predefined words in a programming language that control the behavior of the computer. Keywords help structure programs and convey specific instructions to the system.
4. Translatability:
Programming languages require a compiler or interpreter to convert human-readable code into binary (machine language) so the computer can execute it.
Conclusion:
Understanding these features is essential for writing clear, correct, and efficient code, forming the foundation for all programming tasks.
Lecture 12: Usage of Programming Languages
In this lecture, we’ll explore how programming languages are used to bridge the gap between humans and computers, and their practical applications in software development.
Key Uses:
Human-Machine Communication: Allow humans to give instructions that computers can understand and execute.
Software Development: Create programs, applications, and systems that perform specific tasks.
System Communication: Enable different computer systems to exchange information effectively.
Machine Control: Direct and manage the behavior of devices and machinery.
Data Processing: Manipulate, analyze, and manage data efficiently.
Task Automation: Automate repetitive or complex tasks to save time and reduce errors.
Conclusion:
Programming languages are essential tools that empower us to build software, control machines, process data, and automate workflows, making them the backbone of modern technology.
Lecture 13: Types of Programming Languages
In this lecture, we’ll examine the different types of programming languages and their specific purposes in software development.
1. General-Purpose Languages:
Languages that can be used to develop a wide range of software, from desktop to web and mobile applications.
Examples: C, C++, Java, Python
2. Targeted Languages:
Designed for creating a specific type of software or working with specific systems.
Examples: PHP (web development), MySQL (databases)
3. Low-Level Languages:
Allow direct control over hardware and memory, often used for embedded systems or performance-critical software.
Examples: C, C++, Arduino, Python
4. High-Level Languages:
Focus on software development without directly interacting with hardware. Easier to read and maintain.
Examples: Java, JavaScript, Python, TypeScript, C/C++
5. Scripting Languages:
Used to automate tasks, add new features, or enhance existing software.
Examples: Python, JavaScript, Bash, PowerShell, Lua
6. Markup Languages:
Structure and format data rather than perform logic operations.
Examples: HTML, XML, CSS, Markdown
Conclusion:
Understanding the types of programming languages helps you choose the right tool for the right task and apply it effectively in software projects.
Lecture 14: What is a Language Translator?
In this lecture, we’ll explore language translators—tools that convert code from one form to another so computers can execute it.
Definition:
A language translator is software that converts source code (human-readable instructions) into a format the computer can understand, typically binary.
Types of Language Translators:
Compiler: Converts entire source code into binary before execution.
Examples: GCC (C/C++), Javac (Java)
Interpreter: Converts and executes code line by line at runtime.
Examples: CPython (Python), Zend Engine (PHP), V8 (JavaScript)
Transpiler: Converts code from one programming language into another.
Examples: Godzilla, Babel, Google Web Toolkit
Conclusion:
Understanding language translators is essential for efficiently converting human-readable code into machine-executable instructions and choosing the right tool for development tasks.
Lecture 15: Compiler vs Interpreter:
In this lecture, we compare compilers and interpreters, two key tools for translating programming code into machine-readable instructions.
Compiler:
Converts the entire source code into binary before execution.
Provides feedback after the full code is compiled.
Interpreter:
Converts and executes code line by line.
Provides feedback immediately for each line.
Conclusion:
Understanding the difference helps you choose the right translation method for debugging, performance, and development workflow.
Lecture 16: Program Execution Process:
In this lecture, we explore how a program moves from source code to execution on a computer.
Steps in the Execution Process:
Source Code: The instructions written in a programming language.
Preprocessor: Prepares the code for compilation by removing comments and white spaces.
Compiler/Interpreter: Translates code into assembly instructions and writes them into registers.
Assembler: Converts assembly code into machine language (binary).
Linker: Incorporates external code, such as libraries, into the program.
Loader: Loads the program into memory for execution.
Execution: The program runs, performing the tasks it was designed for.
Conclusion:
Understanding the program execution process helps developers debug, optimize, and efficiently manage software from writing code to running it on a machine.
Lecture 17: Compile Time vs Run Time:
In this lecture, we explain the difference between compile time and run time, two critical stages in program execution.
1. Compile Time:
The stage where the program is being converted from source code into binary.
The program is not yet loaded into memory and is not running.
2. Run Time:
The stage where the program is loaded into memory and actively executing.
Users can now interact with the program and access its features.
Conclusion:
Understanding compile time and run time helps developers debug, optimize performance, and manage program execution effectively.
Lecture 18: What is a Run Time Environment?
Definition:
A run time environment (RTE) is the combination of hardware and software components required for a computer program to run successfully.
Key Point:
Every program requires a specific run time environment. Without the right setup, the program may fail to execute or run with errors.
Examples:
Java Programs → Java Runtime Environment (JRE)
C/C++ Programs → GCC Compiler
Music Playback → Media Player (VLC) + Speakers
Games → Speakers + 16GB RAM + DirectX 12
Conclusion:
Understanding runtime environments ensures you can set up, run, and troubleshoot programs effectively, making it a critical part of software development and execution.
Lecture 19: Text Editors
Definition:
A text editor is software designed to create and edit text documents. In programming, specialized text editors make it easier for developers to write, organize, and manage code.
Key Features:
Unlike IDEs, text editors do not include built-in compilers or interpreters, but they offer powerful features such as:
Syntax highlighting (color-coded code)
Line numbering
Integrated terminals
Extensions and plugins to enhance productivity
Examples:
Notepad – basic text editing
Visual Studio Code – advanced code editing with extensions
Sublime Text – lightweight, fast, and customizable
Brackets – focused on web development
Atom – open-source, hackable text editor
Conclusion:
Text editors are essential tools for developers, offering a flexible and efficient environment for writing and managing code without the extra complexity of full IDEs.
Lecture 20: Integrated Development Environment (IDE)
Definition:
An Integrated Development Environment (IDE) is specialized software created to help developers build, test, and manage software efficiently. Unlike text editors, IDEs come with pre-installed tools that streamline the entire development process, including:
Compilers & Interpreters
Consoles & Terminals
Debuggers
Profiling tools
Code inspectors and analyzers
Key Point:
IDEs are designed exclusively for software development, making them a complete workspace for programmers.
Examples:
Java → Eclipse, NetBeans
C/C++ → Code::Blocks
Python → PyCharm
Mobile Apps → Android Studio, Xcode
Conclusion:
Using an IDE allows developers to write, test, debug, and optimize code in one environment, improving productivity and making software development faster and more reliable.
Lecture 21: Debugger, Debugging, and Bug
Introduction
When writing computer programs, it is almost impossible to avoid mistakes. These mistakes can cause a program to stop working, behave incorrectly, or produce unexpected results. To ensure software runs smoothly, programmers need tools and techniques to find and fix these errors. This lecture introduces three important concepts: the bug (the error itself), debugging (the process of fixing it), and the debugger (the tool used to detect and solve errors).
Debugger
A debugger is a special software tool used by programmers to identify and fix errors in a computer program. It allows the developer to run the program step by step, monitor variables, and understand where and why the program fails.
Debugging
Debugging is the process of detecting, analyzing, and correcting errors (bugs) in a program. This can be done manually by the developer or automatically with the help of a debugger or other debugging tools.
Bug
A bug is an error, flaw, or unexpected behavior in a computer program that prevents it from working correctly or as intended.
Lecture 22: Source Code, Source Files, and Modules
Introduction
Every computer program begins as text written by a programmer. This text is called source code. To organize this code, we save it in files, and sometimes divide it into smaller, reusable parts called modules. In this lecture, we will explore these three concepts step by step.
1. Source Code
Source code refers to the actual lines of instructions written by a programmer to create a computer program.
It is written in a programming language such as C++, Java, Python, or PHP.
It tells the computer what to do step by step.
Common synonyms: code, commands, instructions, or code snippets.
Example:
print("Hello, World!")
This is a simple line of source code written in Python.
2. Source File
A source file is the file where source code is saved.
It usually has a specific extension based on the programming language, such as .c for C, .java for Java, .py for Python, or .php for PHP.
These files can be opened and edited in a text editor or an Integrated Development Environment (IDE).
Example:
hello.py → a Python source file
main.java → a Java source file
3. Module
A module is a special type of source file that usually contains code designed for a specific purpose or feature.
Modules make programs easier to organize, reuse, and maintain.
In many languages, modules can be imported into other files.
Example:
In Python:
# math_utils.py
def add(a, b):
return a + b
This file is a module because it contains functions that can be reused in other programs.
Key Takeaway:
Source Code: Instructions written by the programmer.
Source File: The file where source code is stored.
Module: A specialized source file that usually handles a particular feature.
Lecture 23: Algorithms
Introduction
Every task, from cooking a meal to solving a programming problem, follows a sequence of steps. In programming, these sequences are called algorithms. Understanding algorithms helps you solve problems efficiently and write programs that work correctly. This lecture will explain what algorithms are, show simple examples, and introduce common types.
Definition
An algorithm is a step-by-step procedure for accomplishing a specific task.
Example: Cooking Pasta
Boil water for 15 minutes.
Add pasta to the boiling water.
Boil for another 20 minutes.
Pasta is ready to serve.
This simple procedure is an algorithm because it gives exact steps to achieve the goal of cooking pasta.
Types of Algorithms
Sorting Algorithms – Arrange data in a particular order (e.g., ascending or descending).
Searching Algorithms – Find specific data within a dataset.
Merge Algorithms – Combine or merge data efficiently.
Key Takeaway:
An algorithm is like a recipe: it provides precise steps to accomplish a task, whether in cooking or programming.
Lecture 24: Models
Introduction
When building software, developers need structured ways to organize data, logic, and user interfaces. Models provide frameworks and guidelines to design programs efficiently and consistently. This lecture introduces the concept of models, their components, and how they guide software development.
Definition
A model is a framework or guideline used to design and program a specific type of software. It standardizes the way software is organized and interacts with users or data.
Example: MVC Model
The MVC (Model-View-Controller) model is a popular framework used in software development:
Model – Stores and manages the data or information of the application.
View – The visible part of the software; the user interface (UI/UX) that users interact with.
Controller – Manages the flow of information between the model and the view, handling user input and application logic.
Key Points
Models are often standardized by conventions or regulatory boards to ensure consistency.
Algorithms can be created by developers as needed within these models to solve specific problems.
Key Takeaway:
Models provide a structured approach to software development, separating data, interface, and control logic for better organization, maintainability, and scalability.
Lecture 25: Software Development Life Cycle (SDLC)
Introduction
In this lecture, we will explore the Software Development Life Cycle (SDLC), a structured approach used to guide the development of software from start to finish. SDLC ensures that software is planned, designed, built, tested, and maintained efficiently while meeting user requirements.
Definition
The Software Development Life Cycle (SDLC) is the series of stages followed during the development of software, from initial research to deployment and maintenance.
Stages of SDLC
Research – Gather information about the software requirements, user needs, and project scope.
Design – Plan the system architecture, database structure, and user interface layout.
Development – Write the actual code to build the software.
Testing – Verify that the software works correctly and meets requirements.
Documentation – Create guides and manuals for developers and users.
Deployment – Launch or publish the software so it can be used.
Production – The software becomes fully available for use.
Maintenance – Update, upgrade, and fix the software to ensure it continues to work correctly.
Types of SDLC Models
Waterfall Model – Sequential approach, completing one stage before moving to the next.
Spiral Model – Iterative approach, allowing repeated refinement and risk assessment.
(Other models include Agile, V-Model, Incremental, etc.)
Key Takeaway
SDLC provides a roadmap for software development, ensuring that programs are well-planned, efficiently built, tested, and maintained for long-term usability.
Lecture 26: Software Testing
Introduction
In this lecture, we will explore software testing, a crucial step in software development that ensures programs work correctly and reliably. Testing helps identify errors early, improves software quality, and ensures that the system meets user requirements.
Definition
Software testing is the process of verifying that individual components and the entire software system function as expected.
Types of Software Testing
Unit Testing – Focuses on testing individual features or components to ensure they work correctly in isolation.
Example: Checking if a login function correctly validates a username and password.
Integrated Testing – Examines the entire software system to ensure that all components work together properly and meet requirements.
Example: Testing the full e-commerce system, including login, product search, cart, and checkout, to ensure everything works seamlessly.
Key Takeaway
Software testing is essential to deliver reliable and bug-free programs. By performing both unit and integrated testing, developers can catch errors early and ensure the system functions correctly as a whole.
Lecture 27: Software Architecture
Introduction
In this lecture, we will explore software architecture, which is the blueprint of a software system. Understanding software architecture helps developers design systems that are organized, maintainable, and scalable, showing how all components interact with each other.
Definition
Software architecture is a pictorial or conceptual representation of a software system, illustrating its individual components and how they interact.
Types of Software Architecture
Database Architecture – Shows the structure of databases, including tables, relationships, and how data flows between components.
Process Architecture – Focuses on the design and organization of processes or threads within a system. This includes how tasks are executed asynchronously or synchronously.
System Architecture – Provides an overall view of how all components of a software system are connected and work together.
Designing Software
UI/UX Design – Tools like Figma and Photoshop are used to design user interfaces.
Database Design – Tools like MySQL Workbench help structure databases.
System Design – Tools like Draw.io assist in creating diagrams for system architecture.
Key Takeaway
Software architecture acts as a roadmap for development, helping developers visualize, plan, and implement systems efficiently while ensuring all components work together seamlessly.
Lecture 28: Computer Hardware Architecture
Introduction
In this lecture, we will explore computer hardware architecture, which explains how the physical components of a computer interact to process data. Understanding hardware architecture is essential for programmers and developers to write efficient software that works well with the system.
Definition
Computer hardware architecture is the design and organization of a computer’s physical components, including the CPU, memory, buses, and input/output systems, showing how data flows through the system.
Key Components of Computer Hardware
CPU (Central Processing Unit)
Often called the "brain" of the computer.
Executes instructions from programs and controls the operation of other hardware components.
Consists of two main parts:
ALU (Arithmetic Logic Unit): Performs calculations and logical operations.
Control Unit: Directs the flow of data between the CPU, memory, and peripherals.
Memory
Stores data and instructions temporarily or permanently.
Primary Memory (RAM): Fast, temporary storage used while programs are running.
Secondary Memory (Hard drives, SSDs): Permanent storage for files and software.
Buses
Pathways that carry data, instructions, and signals between CPU, memory, and peripherals.
Types include:
Data Bus: Transfers data between components.
Address Bus: Transfers information about where data should go.
Control Bus: Transfers control signals to coordinate operations.
Input, Processing, and Output
Input – Devices like keyboards, mice, and scanners send data to the CPU.
Processing – The CPU interprets instructions, performs calculations, and manipulates data.
Output – Processed data is sent to output devices like monitors, printers, or speakers for the user to access.
Key Takeaway
Computer hardware architecture defines how data moves from input devices, through memory and the CPU, and finally to output devices. Understanding these components helps developers write efficient, compatible software.
Lecture 29: Software Documentation
Introduction
In this lecture, we will explore software documentation, a crucial part of software development. Documentation provides written explanations and illustrations about how software is developed, how it works, and how it can be maintained or upgraded. Proper documentation ensures that both users and developers can understand and use the software effectively.
Definition
Software documentation is written text and illustrations that explain:
How the software is developed
How the software functions
How to maintain and upgrade the software
Types of Software Documentation
Product Documentation – Intended for end users or operators:
User Documentation: Guides such as user manuals and FAQs that help users operate the software.
System Documentation: Installation guides and setup instructions for end users or system administrators.
Technical Documentation – Intended for software engineers and developers:
Database Architecture: Explanation of the database design and structure.
System Architecture: Overview of system components and their interactions.
API Documentation: Instructions on using application programming interfaces.
Source Code Documentation: Comments and explanations within the code itself.
Testing Documentation: Records of testing procedures and results.
Key Takeaway
Software documentation bridges the gap between users and developers. Product documentation ensures smooth software usage, while technical documentation helps engineers maintain, debug, and upgrade the system efficiently.
Lecture 30: Software Efficiency
Introduction
In this lecture, we will explore software efficiency, which measures how well a program performs its tasks. Efficient software uses system resources wisely, runs quickly, and provides a smooth user experience. Understanding efficiency helps developers create high-performing applications.
Definition
Software efficiency is the process of analyzing a program’s performance to ensure it achieves optimal speed and resource usage.
Key Factors of Software Efficiency
Space (Memory Usage) – Efficient software uses only the required memory or storage space, avoiding unnecessary consumption.
Speed (Execution Time) – Efficient software completes tasks in the shortest possible time without delays.
Key Principle
An efficient software is one that uses minimal resources (space) while accomplishing tasks quickly (speed).
Key Takeaway
Software efficiency ensures programs run smoothly and reliably, making optimal use of memory and executing tasks as quickly as possible.
Lecture 31: Resources
Introduction
In this lecture, we will explore computer resources, which are the physical and logical components that make up a computer system. Understanding these resources helps developers write software that interacts efficiently with the system.
Definition
Resources are assets or components that belong to a computer, encompassing all the individual parts that allow it to function.
Examples of Computer Resources
Memory
Primary Memory: Fast, temporary storage used by the CPU, including Registers, Cache, and RAM.
Secondary Memory: Permanent storage for files and programs, such as HDDs (Hard Disk Drives) and SSDs (Solid State Drives).
CPU (Central Processing Unit)
The “brain” of the computer, responsible for executing instructions.
Examples: Intel Core i5, AMD Ryzen 7.
Input/Output Devices
Screen/Monitor: Displays information to the user.
Keyboard: Allows users to input data.
Speakers: Output sound and audio signals.
Key Takeaway
Computer resources include memory, processing units, and input/output devices. Understanding these components helps in developing software that efficiently uses the system’s assets.
Lecture 32: Computer Memory (Software Level)
Introduction
In this lecture, we will explore computer memory at the software level, focusing on how memory is structured, accessed, and used to store data efficiently. Understanding memory management helps developers optimize programs for speed and reliability.
Definition
Computer memory is a block of pages with physical and logical addresses used to store data.
Memory Addresses
Physical Address
A real address in memory, usually represented as a hexadecimal number (e.g., 0xffae).
Points directly to a specific memory page where data is stored.
Logical Address
A virtual address generated by the system (e.g., 0xabeff1).
May not exist physically but can map to an actual memory page through memory management.
Data Structure
A data structure is a way to store and organize data in memory to allow efficient operations such as search, insertion, and deletion.
Examples include arrays, linked lists, stacks, queues, and trees.
Key Takeaway
Computer memory at the software level involves both physical and logical addresses. Using proper data structures allows programs to store and access data efficiently, improving performance and reliability.
Lecture 33: Installations
In this course, you will learn the fundamental features common to all programming languages, making it easier to pick up any language you choose.
For practical demonstrations, I will use multiple programming languages to show that all languages share the same core concepts and to illustrate how these concepts work in each language.
The programming languages covered include:
C/C++ (primary language of instruction)
Java
PHP
Python
This approach ensures you understand universal programming principles while gaining hands-on experience in several languages.
Lecture 34: Installation of IDEs and Run-Time Environments (RTEs)
Introduction
In this lecture, you will learn how to install and set up the necessary development environments for different programming languages. A proper setup is essential to write, run, and test your programs efficiently.
Installing Run-Time Environments and IDEs
C/C++ – Install Code::Blocks, which includes the compiler and IDE for writing and running C/C++ programs.
Java – Install Eclipse IDE along with the Java Development Kit (JDK) for Java programming.
PHP – Install XAMPP, which provides a PHP runtime environment, Apache server, and MySQL database.
Python – Install PyCharm IDE along with the Python interpreter for Python development.
Note
The primary language of instruction in this course will be C/C++, but installations for all listed languages will be demonstrated for practice and comparative understanding.
Lecture 35: Installing C/C++ Run-Time Environment and Code::Blocks IDE
Introduction
In this lecture, you will learn how to install the C/C++ Run-Time Environment (RTE) and the Code::Blocks IDE. Setting up your development environment correctly is essential for writing, compiling, and running C/C++ programs.
Steps to Install C/C++ RTE and Code::Blocks
Download Code::Blocks
Visit the official Code::Blocks website and download the version that includes the MinGW compiler (this provides the C/C++ run-time environment).
Install Code::Blocks
Run the installer and follow the on-screen instructions.
Ensure that the compiler is included during installation.
Verify Installation
Open Code::Blocks.
Create a new C/C++ project and write a simple program, such as:
#include <iostream>
using namespace std;
int main() {
cout << "Hello, World!" << endl;
return 0;
}
4. Compile and run the program to confirm everything is working correctly.
Key Takeaway
Once Code::Blocks and the C/C++ compiler are installed, you are ready to write, compile, and execute C/C++ programs, which forms the foundation for all practical exercises in this course.
Lecture 36: Installing PHP Run-Time Environment and VSCode IDE
Introduction
In this lecture, you will learn how to install the PHP Run-Time Environment (RTE) and the VSCode IDE. Proper setup allows you to write, run, and test PHP programs efficiently on your computer.
Steps to Install PHP RTE and VSCode
Download and Install PHP
Visit the official PHP or XAMPP website and download PHP (via XAMPP recommended for beginners, as it includes Apache server and MySQL).
Run the installer and follow the on-screen instructions.
Verify installation by opening a terminal/command prompt and running:
php -v
Download and Install VSCode IDE
Visit the Visual Studio Code website and download VSCode.
Install VSCode and optionally add the PHP extension for better coding support.
Verify Installation and Write a Simple Program
Open VSCode, create a new PHP file, and write a simple program:
<?php
echo "Hello, World!";
?>
5. Run the program in your browser or terminal to ensure everything works correctly.
Key Takeaway
Once PHP and VSCode are installed, you are ready to write, run, and debug PHP programs, forming the foundation for all practical exercises in PHP development.
Lecture 37: Installing Java Run-Time Environment and Eclipse IDE
Introduction
In this lecture, you will learn how to install the Java Run-Time Environment (JRE) and the Eclipse IDE. Setting up your Java development environment correctly is essential for writing, compiling, and running Java programs.
Steps to Install Java RTE and Eclipse
Download and Install Java JDK
Visit the official Oracle or OpenJDK website to download the Java Development Kit (JDK).
Run the installer and follow the on-screen instructions.
Verify the installation by opening a terminal/command prompt and running:
java -version
Download and Install Eclipse IDE
Visit the Eclipse website and download the Eclipse IDE for Java Developers.
Run the installer and follow the on-screen instructions to complete the setup.
Verify Installation and Write a Simple Program
Open Eclipse and create a new Java project.
Write a simple program:
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello, World!");
}
}
5. Run the program to ensure your environment is working correctly.
Key Takeaway
Once the Java JDK and Eclipse IDE are installed, you are ready to write, compile, and run Java programs, enabling you to practice Java concepts effectively.
Lecture 38: Installing Python Run-Time Environment and IDEs
Introduction
In this lecture, you will learn how to install the Python interpreter and development environments. Setting up Python correctly allows you to write, run, and test Python programs efficiently.
Steps to Install Python RTE and IDEs
Download and Install Python Interpreter
Visit the official Python website, download the latest version, and run the installer.
Make sure to check the option to add Python to PATH.
Verify installation by opening a terminal/command prompt and running:
python --version
Download and Install PyCharm IDE
Visit the JetBrains website, download PyCharm (Community Edition is free), and install it.
Download and Install VSCode
Download Visual Studio Code from the official website.
Install VSCode and add the Python extension for full language support.
Verify Installation and Write a Simple Program
Open your chosen IDE, create a new Python file, and write:
print("Hello, World!")
6. Run the program to confirm everything works correctly.
Key Takeaway
With Python and your IDEs installed, you are ready to write, run, and debug Python programs, laying the foundation for all hands-on Python exercises in this course.
Lecture 39: Review – Structure of First Programs
Introduction
In this lecture, we will review the common structure of first programs across programming languages. Understanding these similarities helps you quickly adapt to new languages.
Common Structure of First Programs
Header / Imports / Modules
Include necessary libraries or modules.
Examples:
C++: #include <iostream>
Java: import java.util.*;
Python: import sys
PHP: <?php
Main Function / Entry Point
The starting point where program execution begins.
Examples:
C++: int main()
Java: public static void main(String[] args)
Python: global scope
PHP: script runs within <?php ?> tags
Executable Statements
Instructions that perform tasks, like printing output or performing calculations.
Example: cout << "Hello, World!"; (C++)
Program Output
The result displayed on the screen after execution, e.g., “Hello, World!”
Key Takeaway
All programming languages share a similar basic structure: headers/imports, main function, executable statements, and output. Mastering this structure makes learning new languages faster and easier.
Lecture 40: C++ First Program Structure Review
Introduction
In this lecture, we will review the structure of a basic C++ program. Understanding this structure helps you write correct and organized programs.
Key Components of a C++ Program
Header Files
Include libraries needed for the program, e.g.,
#include <iostream>
Main Function
Entry point of the program:
int main() {
// Code goes here
return 0;
}
Statements and Instructions
Actions performed by the program, such as printing output:
std::cout << "Hello, World!" << std::endl;
Output
The result displayed on the screen, e.g., “Hello, World!”
Key Takeaway
A basic C++ program includes headers, a main function, executable statements, and output. Recognizing this structure helps you write your first C++ programs confidently.
Lecture 41: Java First Program Structure Review
Introduction
In this lecture, we will review the structure of a basic Java program. This will help you understand how Java organizes code and where execution begins.
Key Components of a Java Program
Class Definition
Every Java program must be inside a class.
public class HelloWorld {
Main Method
Entry point of the program where execution starts.
public static void main(String[] args) {
// Code goes here
}
Statements and Instructions
Actions performed by the program, e.g., printing text:
System.out.println("Hello, World!");
Output
When run, the program displays:
Hello, World!
Key Takeaway
A Java program includes a class, the main method, executable statements, and output. Recognizing this structure ensures you can write and run your first Java programs successfully.
Lecture 42: Python First Program Structure Review
Introduction
In this lecture, we will review the structure of a basic Python program. Python is simpler than many other languages because it doesn’t require a main function to start execution.
Key Components of a Python Program
Imports (Optional)
Add modules or libraries if needed.
import sys
Statements and Instructions
Write code directly without extra setup.
print("Hello, World!")
Functions (Optional)
Programs can be organized into functions, e.g.:
def main():
print("Hello, World!")
main()
Output
When run, the program displays:
Hello, World!
Key Takeaway
Python programs are straightforward—just write statements or use functions. Its simplicity makes it one of the easiest languages for beginners.
Lecture 43: PHP First Program Structure Review
Introduction
In this lecture, we will review the structure of a basic PHP program. PHP is a server-side language, so programs are usually written inside special tags and run on a server.
Key Components of a PHP Program
PHP Opening Tag
Every PHP script begins with:
<?php
Statements and Instructions
Code that performs tasks, such as printing text:
echo "Hello, World!";
PHP Closing Tag (Optional)
Scripts can end with ?>, but in many modern practices, it is left out.
Output
When run in a browser or terminal, the program displays:
Hello, World!
Key Takeaway
A PHP program is written inside <?php ?> tags and consists of simple statements like echo. This makes PHP programs easy to start and run on a local or web server.
Lecture 44: What is a Data Type?
Introduction
In this lecture, we will learn about data types—the building blocks of all programming languages. Data types define what kind of information a program can accept, store, and process in memory.
Definition
A data type is a keyword that determines the nature and format of information a program will use to perform operations. Examples include numbers, letters, and collections.
Categories of Data
Numbers
Used for mathematical calculations.
Examples: byte, short, int, long, float, double.
Letters and Text
Used for characters, words, or logical values.
Examples: char, string, boolean.
Collections
Used to store groups of values or structured information.
Examples: array, hash map, class, object, interface, namespace.
Types of Data Types
Primitive Data Types
Basic, built-in data types that are not made from combinations of other types.
Examples: int, long, byte, boolean, short.
Derived Data Types
Formed by combining primitive data types or using them in structured ways.
Examples: arrays, hash maps, classes, objects.
Key Takeaway
Data types define how information is stored and processed in a program. Understanding the difference between primitive and derived types helps you write more efficient and organized code.
Lecture 45: Data Types Chart
Introduction
In this lecture, we will go through the most common data types in programming. Each type defines the nature of information a program can handle.
Byte
Used for whole numbers, typically small integers.
Examples: 34, 100, 200
Short
Stores medium-range whole numbers.
Examples: 1200, -300
Int (Integer)
The most common type for whole numbers.
Examples: 5, -12, 30
Long
Used for larger whole numbers that go beyond the range of int.
Examples: 100, 3000
Float
Represents decimal numbers with up to 7 decimal places.
Examples: 0.545, 3.142
Double
Represents decimal numbers with higher precision (up to 15 decimal places).
Examples: 0.123456789012345
Char (Character)
Stores a single character, letter, or number in quotes.
Examples: 'a', 'A', '1'
String
Represents a sequence of characters, usually words or text.
Examples: "Hello World"
Boolean / Bool
Represents logical values, either true or false.
Examples: true, false
Array / List
Stores multiple values in order.
Examples: [1, 4, 5], ["a", "b"]
Hashmap / Dictionary / Object
Stores key-value pairs.
Examples: { "name": "Joel", "age": 20 }
None / Null
Represents “no value” or empty data.
Examples: null, None
Class
Blueprint used to simulate real-life objects.
Examples: Car, Person
Key Takeaway
Each data type has a specific role—whether handling numbers, text, logical values, or collections. Choosing the right type ensures efficiency and clarity in your programs.
Lecture 46: Exercise 1 – Data Types
Introduction
In this exercise, you will practice identifying and using different data types in multiple programming languages. This hands-on activity reinforces your understanding of primitive and derived data types, and their specific uses.
Instructions
Complete Each Exercise Four Times
Implement each exercise twice in a strongly typed language (C/C++ or Java).
Implement each exercise twice in a weakly typed language (Python or PHP).
Continue practicing until you fully understand the concept and can explain it confidently.
Coding Guidelines
Type all code yourself—do not copy-paste or use AI-generated solutions.
You may research examples to understand concepts, but the implementation must be your own.
File Organization
Save each completed exercise in separate text files:
data_types_1.txt
data_types_2.txt
data_types_3.txt
data_types_4.txt
Exercise: Data Types Practice
For each of the following data types:
Primitive: byte, short, int, long, float, double, char, boolean
Derived: string, array (or list), HashMap / Dictionary / Object, null (none), class
Task:
Provide a brief description of each data type.
Indicate whether it is primitive or derived.
Explain the nature or format of data it is designed to store.
Key Takeaway
This exercise will help you:
Distinguish between primitive and derived data types.
Understand what kind of data each type stores.
Practice coding in multiple languages to reinforce concepts.
Lecture 47: Variables
Introduction
In this lecture, we will learn about variables, one of the most fundamental concepts in programming. Variables allow programs to store and manipulate data dynamically.
Definition
A variable is a named storage location in a program that holds a value, which can change during program execution. Think of it as a container where you can temporarily store data for use in calculations, logic, or output.
Examples of Variable Values
Variables can store numbers, characters, or memory addresses. Examples include:
0xffba, 0xffaa, 0xaac34, 0xaacff
These hexadecimal values represent data stored in memory.
Key Takeaway
Variables are essential for storing and manipulating data in programs. Understanding them is the first step to writing dynamic and flexible code.
Lecture 48: Parts of a Variable
Introduction
In this lecture, we will break down the key components of a variable. Understanding these parts helps you declare, initialize, and use variables correctly in any programming language.
Key Parts of a Variable
Data Type
Specifies the kind of data the variable will store.
Examples: int, float, string, boolean.
Name
A unique identifier for the variable used to reference its value.
Example: age, myName.
Value
The actual data stored in the variable.
Example: 30 for age, "John Wells" for myName.
Memory Location
Behind the scenes, a variable points to a specific place in the computer’s memory where its value is stored.
Variable Declaration and Initialization
Declaration: Defines the variable’s data type and name.
int age;
String myName;
Initialization: Assigns a value to the variable.
int age = 30;
String myName = "John Wells";
Key Takeaway
A variable always has a data type, name, value, and memory location. Declaring and initializing variables correctly is essential for proper program execution.
Lecture 49: Naming Variables and Variable Naming Convention
Introduction
In this lecture, we will learn how to name variables correctly and follow naming conventions. Proper naming improves code readability, maintainability, and helps prevent errors.
Rules for Naming Variables
Allowed Characters
Variable names can contain letters, numbers, and underscores (_).
Starting Character
Names must start with a letter or an underscore.
Variable names cannot start with a number.
Variable Naming Conventions
camelCase
The first word is lowercase, and each subsequent word starts with a capital letter.
Example:
int startDrivingCar = 0;
Underscore (snake_case)
Words are separated by underscores.
Example:
int start_driving = 2;
Key Takeaway
Following proper rules and conventions for variable names ensures your code is clear, readable, and maintainable.
Lecture 50: Variables Practical's Introduction
Introduction
In this lecture, we will put theory into practice by creating and using variables in multiple programming languages: C++, Java, Python, and PHP. You will learn how to declare variables, assign values, and display them on the screen or console.
Practical Steps
Declare a Variable for Each Data Type
For each language, create variables of different types: numbers, strings, booleans, arrays/lists, and objects (if applicable).
Assign Values to Variables
Initialize each variable with a value appropriate to its type.
Print or Display Each Variable
Show the value of each variable on the console or screen using the language-specific command:
C++: cout << variable << endl;
Java: System.out.println(variable);
Python: print(variable)
PHP: echo $variable;
Example in C++
int age = 25;
float height = 5.9;
char initial = 'J';
bool isStudent = true;
string name = "John";
cout << age << endl;
cout << height << endl;
cout << initial << endl;
cout << isStudent << endl;
cout << name << endl;
Example in Python
age = 25
height = 5.9
initial = 'J'
is_student = True
name = "John"
print(age)
print(height)
print(initial)
print(is_student)
print(name)
Key Takeaway
By practicing variables in multiple languages, you reinforce understanding of data types, declaration, initialization, and output, making it easier to write functional programs across different languages.
Lecture 51: C++ Variables 1 – short, int, long, and float
Introduction
In this lecture, we will learn how to declare and use numeric variables in C++. Specifically, we will cover short, int, long, and float types, which are commonly used to store whole numbers and decimal numbers.
Variable Types and Examples
short
Stores small whole numbers.
Example:
short age = 25;
int
Stores standard whole numbers.
Example:
int count = 100;
long
Stores large whole numbers, larger than int.
Example:
long population = 1000000;
float
Stores decimal numbers (single precision).
Example:
float height = 5.9;
Printing Variables
Use cout to display the values on the console:
cout << "Age: " << age << endl;
cout << "Count: " << count << endl;
cout << "Population: " << population << endl;
cout << "Height: " << height << endl;
Key Takeaway
Understanding these numeric types allows you to store and manipulate both small and large numbers, as well as decimal values, which is essential for calculations in C++.
Lecture 52: C++ Variables 2 – string, boolean, signed, and unsigned
Introduction
In this lecture, we will explore additional C++ variable types that go beyond basic numbers. We will cover string for text, boolean for logical values, and signed/unsigned modifiers for numeric variables.
Variable Types and Usage
string
Stores sequences of characters, such as words or sentences.
string name = "John";
boolean (bool)
Stores logical values: true or false.
bool isStudent = true;
signed
Default for integers; allows both positive and negative numbers.
signed int temperature = -5;
unsigned
Only allows positive numbers (and zero), useful when negative values are not needed.
unsigned int population = 1000;
Printing Variables
cout << "Name: " << name << endl;
cout << "Is Student: " << isStudent << endl;
cout << "Temperature: " << temperature << endl;
cout << "Population: " << population << endl;
Key Takeaway
Understanding these types lets you store text, logical values, and control integer ranges, which is essential for writing efficient and accurate C++ programs.
Lecture 53: C++ Variables 3 – short, long, long long, unsigned long long
Introduction
In this lecture, we will explore C++ integer types with varying storage sizes. These types let you store numbers of different ranges, from small integers to very large ones.
Variable Types and Usage
short
Small integer type, uses less memory.
short smallNumber = 32000;
long
Larger integer type, can store bigger numbers than int.
long largeNumber = 1000000;
long long
Stores very large integers, beyond long.
long long veryLargeNumber = 1000000000000;
unsigned long long
Only stores positive numbers (and zero), allows extremely large values.
unsigned long long hugeNumber = 1000000000000;
Printing Variables
cout << "Small Number: " << smallNumber << endl;
cout << "Large Number: " << largeNumber << endl;
cout << "Very Large Number: " << veryLargeNumber << endl;
cout << "Huge Number: " << hugeNumber << endl;
Key Takeaway
These integer types give you flexibility in storing numbers of various sizes, optimizing memory usage and handling very large values when needed.
Lecture 54: C++ Variables 4 – Class and Object
Introduction
In this lecture, we will learn how to declare and use variables that are classes and objects in C++. This is a key concept in object-oriented programming (OOP), where classes act as blueprints and objects are instances of those classes.
Concepts and Examples
Class
A class defines a blueprint for an object, including attributes (variables) and methods (functions).
class Car {
public:
string brand;
int year;
};
Object
An object is an instance of a class. You can assign values to its attributes and call its methods.
Car myCar;
myCar.brand = "Toyota";
myCar.year = 2020;
Printing Object Attributes
cout << "Car Brand: " << myCar.brand << endl;
cout << "Car Year: " << myCar.year << endl;
Key Takeaway
Understanding classes and objects allows you to model real-world entities in C++, making programs more organized, reusable, and easier to maintain.
Lecture 55: Java Variables 1 – byte, short, int, long, float
Introduction
In this lecture, we will learn how to declare and use numeric variables in Java. We will focus on byte, short, int, long, and float types, which allow you to store numbers of various sizes and precision.
Variable Types and Usage
byte
Stores very small whole numbers (-128 to 127).
byte age = 25;
short
Stores small whole numbers (-32,768 to 32,767).
short smallNumber = 32000;
int
Standard integer type (-2,147,483,648 to 2,147,483,647).
int count = 100000;
long
Stores large whole numbers beyond the range of int.
long population = 1000000000L;
float
Stores decimal numbers (single precision).
float height = 5.9f;
Printing Variables
System.out.println("Age: " + age);
System.out.println("Small Number: " + smallNumber);
System.out.println("Count: " + count);
System.out.println("Population: " + population);
System.out.println("Height: " + height);
Key Takeaway
These numeric types allow you to store and manipulate whole numbers and decimals efficiently in Java, choosing the type that fits the size and precision required.
Lecture 56: Java Variables 2 – double, char, String, boolean
Introduction
In this lecture, we will explore additional Java variable types used to store decimal numbers, characters, text, and logical values. Understanding these types is essential for writing flexible and accurate programs.
Variable Types and Usage
double
Stores decimal numbers with double precision (up to 15–16 digits).
double pi = 3.14159265359;
char
Stores a single character, enclosed in single quotes.
char initial = 'J';
String
Stores a sequence of characters or text, enclosed in double quotes.
String name = "John";
boolean
Stores logical values: true or false.
boolean isStudent = true;
Printing Variables
System.out.println("Pi: " + pi);
System.out.println("Initial: " + initial);
System.out.println("Name: " + name);
System.out.println("Is Student: " + isStudent);
Key Takeaway
These variable types let you store decimals, characters, text, and logical values, which are fundamental for controlling program behavior and handling diverse data in Java.
Lecture 57: Java Variables 3 – Array
Introduction
In this lecture, we will learn about arrays in Java, which allow you to store multiple values of the same type in a single variable. Arrays are useful for managing collections of data efficiently.
Array Declaration and Initialization
Declaring an Array
int[] numbers; // Declares an array of integers
String[] names; // Declares an array of strings
Initializing an Array
int[] numbers = {1, 2, 3, 4, 5};
String[] names = {"John", "Jane", "Alice"};
Accessing Array Elements
Use the index (starting from 0) to access or modify elements.
System.out.println(numbers[0]); // Output: 1
System.out.println(names[1]); // Output: Jane
numbers[2] = 10; // Updates the third element
Looping Through an Array
for(int i = 0; i < numbers.length; i++) {
System.out.println(numbers[i]);
}
for(String name : names) {
System.out.println(name);
}
Key Takeaway
Arrays let you store and manage multiple values of the same type efficiently, making it easier to perform operations like iteration, search, and manipulation in Java programs.
Lecture 58: Java Variables 4 – Class and Object
Introduction
In this lecture, we will explore classes and objects in Java, which are the foundation of object-oriented programming (OOP). Classes serve as blueprints, and objects are instances of those blueprints that can store data and perform actions.
Concepts and Examples
Class
A class defines attributes (variables) and methods (functions) for objects.
class Car {
String brand;
int year;
}
Object
An object is an instance of a class. You can assign values to its attributes and call its methods.
Car myCar = new Car();
myCar.brand = "Toyota";
myCar.year = 2020;
Printing Object Attributes
System.out.println("Car Brand: " + myCar.brand);
System.out.println("Car Year: " + myCar.year);
Key Takeaway
Understanding classes and objects allows you to model real-world entities in Java, making your programs more organized, reusable, and easier to maintain.
Lecture 59: Python Variables 1 – Numbers, Strings, and List
Introduction
In this lecture, we will learn how to declare and use variables in Python. Python is dynamically typed, which means you don’t need to explicitly declare a data type. We will cover numbers, strings, and lists.
Variable Types and Usage
Numbers
Store integer or decimal values.
age = 25 # integer
height = 5.9 # float
Strings
Store text enclosed in quotes.
name = "John"
List
Stores multiple values in a single variable, can contain different types.
numbers = [1, 2, 3, 4, 5]
names = ["John", "Alice", "Jane"]
Printing Variables
print(age)
print(height)
print(name)
print(numbers)
print(names)
Key Takeaway
Python variables are flexible and dynamically typed, allowing you to store numbers, text, and collections like lists easily for a wide range of programming tasks.
Lecture 60: Python Variables 2 – Tuple and Dictionary
Introduction
In this lecture, we will explore Python variables for storing collections: tuples and dictionaries. These data structures allow you to organize and access multiple values efficiently.
Variable Types and Usage
Tuple
An ordered, immutable collection of items. Once created, you cannot change its elements.
coordinates = (10, 20)
colors = ("red", "green", "blue")
Access elements by index:
print(coordinates[0]) # Output: 10
Dictionary
Stores key-value pairs, allowing quick lookup of values by their keys.
student = {"name": "John", "age": 20, "grade": "A"}
Access values using keys:
print(student["name"]) # Output: John
Printing Variables
print(coordinates)
print(colors)
print(student)
Key Takeaway
Tuples and dictionaries allow you to store and organize multiple values efficiently. Tuples are immutable, while dictionaries provide flexible key-value mapping.
Lecture 61: Python Variables 3 – Class and Object
Introduction
In this lecture, we will explore classes and objects in Python, which are the foundation of object-oriented programming (OOP). Classes act as blueprints, and objects are instances of those blueprints.
Concepts and Examples
Class
Defines attributes (variables) and methods (functions) for objects.
class Car:
def __init__(self, brand, year):
self.brand = brand
self.year = year
Object
An object is an instance of a class. You can assign values to its attributes and call its methods.
my_car = Car("Toyota", 2020)
Printing Object Attributes
print("Car Brand:", my_car.brand)
print("Car Year:", my_car.year)
Key Takeaway
Classes and objects allow you to model real-world entities in Python, making programs more organized, reusable, and easier to maintain.
Lecture 62: PHP Variables 1 – Numbers, Strings, and Arrays
Introduction
In this lecture, we will learn how to declare and use variables in PHP. PHP is a dynamically typed language, so you don’t need to specify a data type. We will cover numbers, strings, and arrays.
Variable Types and Usage
Numbers
Store integer or decimal values.
$age = 25; // integer
$height = 5.9; // float
Strings
Store text enclosed in quotes.
$name = "John";
Arrays
Store multiple values in a single variable. PHP arrays can be indexed or associative.
$numbers = array(1, 2, 3, 4, 5);
$names = array("John", "Alice", "Jane");
Printing Variables
echo $age . "\n";
echo $height . "\n";
echo $name . "\n";
print_r($numbers);
print_r($names);
Key Takeaway
PHP variables are flexible and dynamically typed, allowing you to store numbers, text, and collections like arrays easily for various programming tasks.
Lecture 63: PHP Variables 2 – Std Object
Introduction
In this lecture, we will learn about stdClass objects in PHP, which allow you to create simple objects to store and organize data in a structured way.
Creating and Using Std Objects
Creating an Std Object
$car = new stdClass();
$car->brand = "Toyota";
$car->year = 2020;
Accessing Object Properties
echo "Car Brand: " . $car->brand . "<br>";
echo "Car Year: " . $car->year . "<br>";
Adding More Properties Dynamically
$car->color = "Red";
echo "Car Color: " . $car->color . "<br>";
Key Takeaway
stdClass objects let you store related data in a flexible object structure without defining a full class, which is useful for simple data organization and dynamic objects in PHP.
Lecture 64: PHP Variables 3 – Resource, Null, Class, and Object
Introduction
In this lecture, we will explore special variable types in PHP, including resource, null, and objects created from classes. These types allow you to manage system resources, represent empty values, and structure complex data.
Variable Types and Usage
Resource
Represents a reference to an external resource, such as a file or database connection.
$file = fopen("example.txt", "r"); // $file is a resource
fclose($file);
Null
Represents no value. Can be assigned explicitly.
$data = null;
Class and Object
Classes define blueprints; objects are instances of classes.
class Car {
public $brand;
public $year;
}
$myCar = new Car();
$myCar->brand = "Toyota";
$myCar->year = 2020;
Printing Object Properties
echo "Car Brand: " . $myCar->brand . "<br>";
echo "Car Year: " . $myCar->year . "<br>";
Key Takeaway
These PHP variable types allow you to handle external resources, represent empty values, and organize data using classes and objects, which is crucial for building robust PHP applications.
Lecture 65: Exercise 2 – Variables (C++, Java, Python, PHP)
Introduction
In this exercise, you will declare variables for each data type and display their values across multiple programming languages. This practical will help you apply your understanding of variable types, declaration, and output in real code.
Instructions
Data Types to Cover
Numeric: byte, int, short, long, float, double
Character/Text: char, string
Logical: boolean
Collections: array/list, HashMap (Java), Dictionary (Python), Object (PHP)
Special Types: null/none, class
Exercise Steps
Declare a variable for each data type.
Assign a suitable value.
Print or display the value on the console or screen.
File Organization
Repeat the exercise in four separate files:
variables_1
variables_2
variables_3
variables_4
Complete twice using a strongly typed language (C++ or Java).
Complete twice using a weakly typed language (Python or PHP).
Typing Code
Type all code manually—do not copy, paste, or use generated code.
Example – Strongly Typed (Java)
int age = 25;
float height = 5.9f;
String name = "John";
boolean isStudent = true;
int[] numbers = {1, 2, 3};
HashMap<String, Integer> scores = new HashMap<>();
scores.put("Math", 95);
System.out.println(age);
System.out.println(height);
System.out.println(name);
System.out.println(isStudent);
System.out.println(Arrays.toString(numbers));
System.out.println(scores);
Example – Weakly Typed (Python)
age = 25
height = 5.9
name = "John"
is_student = True
numbers = [1, 2, 3]
scores = {"Math": 95}
print(age)
print(height)
print(name)
print(is_student)
print(numbers)
print(scores)
Key Takeaway
This exercise reinforces variable declaration, initialization, and output across multiple programming languages, building a strong foundation for practical coding skills.
Learn Programming from Scratch 1.0: The Ultimate Beginner's Guide (C/C++, Java, Python & PHP)
Start coding from zero!
This beginner-friendly course is designed to take you from absolute beginner to code-literate with just a few hours of study each week.
Self-paced learning
Real-world examples
Simplified explanations
Hands-on practice
100% video lessons accessible anytime, anywhere
Course Overview
Unlock the world of programming with this all-in-one course! Whether you’ve never written a line of code or want a solid foundation in software development, this course is your launchpad.
What You’ll Learn
· Master core programming concepts applicable to any language.
· Gain a solid understanding of C/C++, Java, Python, and PHP.
· Learn languages used to build web apps, mobile apps, desktop software, and more.
· Learn programming tools, workflows, and best practices.
· Progress from basic to intermediate and advanced programming concepts.
Why This Course Stands Out
· Perfect for absolute beginners—no prior experience required.
· Step-by-step guidance with simple, clear, and technical explanations.
· Hands-on exercises to ensure you actually build real projects.
· Covers multiple languages so you can easily expand your skills.
By the end, you won’t just know how to code—you’ll think like a programmer and have the confidence to tackle real-world projects across multiple languages.
Start your programming journey today and turn your ideas into working software!