0% found this document useful (0 votes)
152 views

Computer Science G10: Programming Languages and Paradigms

This document provides an overview of computer programming languages and paradigms. It discusses the evolution of programming languages from machine languages (1st generation) to artificial intelligence languages (5th generation). It also covers the main programming paradigms including imperative, functional, logic, object-oriented, and concurrent programming. Specific examples of languages that fall under each generation and paradigm are provided. The document also gives an introduction to C++ roots, covering its basis in both C and object-oriented programming concepts like encapsulation, inheritance, and polymorphism. It concludes with notes about studying programming language structures and codes.

Uploaded by

Cairo Diaz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
152 views

Computer Science G10: Programming Languages and Paradigms

This document provides an overview of computer programming languages and paradigms. It discusses the evolution of programming languages from machine languages (1st generation) to artificial intelligence languages (5th generation). It also covers the main programming paradigms including imperative, functional, logic, object-oriented, and concurrent programming. Specific examples of languages that fall under each generation and paradigm are provided. The document also gives an introduction to C++ roots, covering its basis in both C and object-oriented programming concepts like encapsulation, inheritance, and polymorphism. It concludes with notes about studying programming language structures and codes.

Uploaded by

Cairo Diaz
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

Computer-10 Review Notes for First Prelim Exam

Lesson 1: Programming Languages and Paradigms

EVOLUTION OF PROGRAMMING LANGUAGES


First Generation: Machine Languages
Uses a binary code that consists of strings of only zeroes (0) and one (1). Programs
written in 1GL run relatively quickly and efficiently.

Second Generation: Assembly Languages


They usually refer to some form of symbolic or assembly language. Assembly
languages use mnemonics or very short words for commands.

Third Generation: High-Level Languages


Most modern computer languages belong here. 3GL is largely machine-
independent. A 3GL program written for one computer does not have to be rewritten for
another computer that belongs to a different family or environment.

Examples of 3GL
Fortran, Algol60, Algol68, Basic, Pascal, C, and Ada

Fourth Generation: Declarative Languages


4th Generation Languages are more advanced than traditional high-level
programming languages. Commands are usually English-like and do not require traditional
input-process-output logic.

Examples of 4th GL
Standard ML, Lisp, Haskel, SQL, Visual Basic, etc.

Fifth Generation: Artificial Intelligence


5th GLs operate on the concept of solving problems based rules that have been
declared in the program.

Examples of 5th GL
Prolog, OPS5,

OVERVIEW OF PROGRAMMING PARADIGMS


Imperative Programming
- It is the oldest and most traditional model of computing. The word “imperative”
refers to a mood expressing an essential order of command. An imperative
programming language is “how” oriented. It specifies how the computation is to take
place.
Examples of Imperative programming languages are:
Ada, Fortran, Basic, Algol, Pascal, Cobol, Modula & C
Functional Programming
- It is an expression-oriented programming paradigm. Computations are specified
through mathematical functions that evaluate input expressions and convert them
into output values.

Examples of Functional programming languages are:


Lisp, Scheme, Standard ML, Haskell

Logic Programming
- In the logical paradigm, programs are written as logical statements that describe the
properties the solution must have. A logic program does not specify how to compute
the solution, but rather consists of a declarative description of the problem as a set
of rules.

Examples of Logic programming languages are:


Prolog, Lambda, CLP

Object-Oriented Programming
- In object-oriented programming, data structures are viewed as objects, and
programmers create relationship between these objects. A group of objects that
have the same properties, operations, and behaviors, is called a class.

Examples of Object-Oriented programming languages are:


Smalltalk, Simula, Java, and C++

Concurrent and Distributed Programming


- Concurrent or parallel programming is a computer programming technique that
allows for the execution of two or more operations at the same time.

Examples of Concurrent programming languages are:


Parallel Pascal, Concurrent ML

Lesson 2: C++ Roots

- A good C++ program has the elements of both OOP and classic programming
approaches.

C Applies:
A. A procedural approach, where the program is performed step-by-step in a series.
B. A structured approach, where the complicated program is divided into several small
subsets that are each performed separately, later building up to be the whole set.

-C++ applies both Procedural and Structured approaches, plus OOP.


-C++ is more than just an updated C; in fact, it provides more functionality and usability
than the original C language.
What is OOP?
•Object-oriented programming (OOP) was conceived to model real-world objects. In
OOP, the data in a program are viewed as objects with their own attributes and functions.
• The main aim of OOP is to bind together the data and the functions that operate on them
so that no other part of the code can access this data except that function.
• The key to understanding OOP is being able to grasp the concepts behind a “class” and
an “object.”
-An object refers to an entity that can be viewed as either concrete or abstract.
Examples of concrete objects are: cars, books, computers, people, and buildings.
Examples of abstract objects are: subject, idea, course, triangle, and number (intangible
objects)

- A class is a representation or an “abstraction” of an object. It’s like having a plan


design—for instance, to describe how a house (the object) will be built or structured; you
need a blueprint (the class).
-Abstraction describes the common properties of those objects.
- A class is like a blueprint for an object.

In computer programming, seeing things as objects has added benefits such as:
1. The code for an object can be written independently from other objects. This is known
as modularity.
2. Having object promotes code re-use. If an object has already been created, it can be
shared in other programs that require a similar object. In your own program, you can also
have several objects that have the same class.
3. It is easier to debug objects since the code is written separately from the rest of the
program.

OOP Concepts
Encapsulation -This is the process of combining data and function to form a class of
object. - putting the data together as one.

Inheritance - Creation of one class from another class.


-In programming, using a predefined class leads to the inheritance of its original functions,
plus added new ones.

Polymorphism- “Poly” means many and “morph” means forms. So, by adding the two
terms, “polymorphism” means many forms. There may be several instances of different
functions , but they may have been derived from only one and the same function but with a
different name.
NOTE:
- Please study the structure of the program/code of the different
programming languages.
- Refer to your assignment on the different codes based from the given
programming languages from the Lesson 1 Assessment (Elaborate part)

Type of the Exam


Multiple Choice
Picture Analysis

Sample Multiple Choice Item Question:

If you want the sample code below as your output in your computer class, what programming
language will you use?

#include <iostream.h>
Main()
{
cout << “Hello World!”;
return 0;
}

a. C
b. Pascal
c. C++
d. Java

Good Luck and God Bless!

You might also like