0% found this document useful (0 votes)
14 views10 pages

Grade11 Programming LectureNotes AKUEB

The document provides an introduction to programming languages, defining programs and programming languages, and explaining the difference between syntax and semantics. It categorizes programming languages into low-level and high-level types, detailing machine and assembly languages as low-level, and procedural, structured, and object-oriented languages as high-level. The document highlights the characteristics, advantages, and disadvantages of each type, emphasizing their roles in software development.

Uploaded by

Sir Raza Jafri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views10 pages

Grade11 Programming LectureNotes AKUEB

The document provides an introduction to programming languages, defining programs and programming languages, and explaining the difference between syntax and semantics. It categorizes programming languages into low-level and high-level types, detailing machine and assembly languages as low-level, and procedural, structured, and object-oriented languages as high-level. The document highlights the characteristics, advantages, and disadvantages of each type, emphasizing their roles in software development.

Uploaded by

Sir Raza Jafri
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Lecture Notes

Grade 11 - Computer Science (AKUEB)


Topic: Introduction to Programming Languages

Definition of Program and Programming Language


A program is a set of instructions written in a programming language that tells a
computer how to perform a specific task. Programming is the process of designing
and building executable computer programs to accomplish a specific computing
result.

A programming language is a formal language comprising a set of instructions


that can be used to produce various kinds of output. These languages are used to
implement algorithms and communicate with computers effectively.

Difference Between Program Syntax and Semantics


Programming languages have two fundamental aspects: syntax and semantics.

Syntax refers to the structure or the form of code — how the statements must be
written for the compiler or interpreter to understand. For example, in Python, the
correct syntax to print something is print("Hello").

Semantics refers to the meaning of the statements — what the instructions


actually do when executed. Two programs can have the same syntax but different
semantics, depending on how the statements are interpreted by the machine.

Types of Programming Languages


Programming languages are categorized mainly into two groups: low-level
languages and high-level languages. Each category serves different purposes
depending on the level of abstraction from the computer’s hardware.

Low-Level Languages
Low-level languages are closer to machine code and are harder for humans to
read but faster for the computer to execute. These languages provide little or no
abstraction from a computer's instruction set architecture. There are two main
types of low-level languages:
I. Machine Language:
- It is the most basic form of programming language, consisting entirely of binary
digits (0s and 1s).
- Each instruction corresponds directly to a computer operation.
- Example: 10110000 01100001
- It is machine-dependent, meaning a program written for one type of computer
cannot run on another without modification.

II. Assembly Language:


- Assembly language uses symbolic codes (mnemonics) instead of binary codes,
making it slightly easier to understand.
- Example: MOV A, 5 (moves the value 5 into register A).
- It requires an assembler to convert assembly code into machine code.
- Assembly language provides more control over hardware and is often used in
embedded systems, device drivers, and performance-critical applications.

High-Level Languages
High-level languages are designed to be easy for humans to read and write. They
are more abstract and independent of hardware. High-level languages are
translated into machine code through compilers or interpreters. There are several
types:

I. Procedural Language
A procedural language is based on the concept of procedure calls, where
programs are divided into small sections called procedures or functions. Each
procedure performs a specific task.

Examples include C, Pascal, and Fortran.

Advantages:
- Easy to debug and maintain.
- Reusability of code.
- Step-by-step execution flow makes understanding easier.

Disadvantages:
- Difficult to manage large programs.
- Less modular compared to object-oriented approaches.

II. Structured Language


Structured languages emphasize dividing a program into logical blocks such as
functions, loops, and conditionals. Each block has a single entry and exit point.

Examples include C and Pascal.

Key Features:
- Use of control structures such as IF, FOR, and WHILE.
- Encourages top-down design approach.
- Reduces the use of GOTO statements, improving readability and reliability.
- Easier to debug and modify.

III. Object-Oriented Language


Object-oriented programming (OOP) focuses on objects rather than actions. An
object is an instance of a class that combines data and functions into a single unit.

Examples include Java, Python, and C++.

Core Concepts:
- Encapsulation: Bundling of data and methods that operate on that data.
- Inheritance: Ability to create new classes from existing ones.
- Polymorphism: Ability to use one function name for different types of actions.
- Abstraction: Hiding complex details and showing only the necessary features.

Advantages:
- Code reusability through inheritance.
- Easier maintenance and debugging.
- Better organization of complex software systems.

You might also like